#pragma once
#include <cstdint>
/*********************************USERDEFINED ERRCODE************************************/
#define USER_DEFINED_ERRCODE 0x0 /* user defined errcode 用户自定义错误码*/
/*********************************errors related to online command (start)************************************/
#define ROBOT_POWERED_OFF 0x0F0001           /* robot is now powered-off, please turn on it*/
#define ROBOT_NOT_ENABLED 0x0F0002           /* robot is not enabled*/
#define OPERATION_IN_WRONG_MODE 0x0F0003     /* operation is not supported in current mode*/
#define KINEMATICS_FAILED 0x0F0004           /* failed to do the inverse kinematics*/
#define INFINITE_JOINT_POSITION 0x0F0005     /* infinite joint position command was given*/
#define JOINT_HIT_POS_HLIMIT 0x0F0006        /* cannot move on since it hits the joint's positive hard limit*/
#define JOINT_HIT_NEG_HLIMIT 0x0F0007        /* cannot move on since it hits the joint's negative hard limit*/
#define JOINT_HIT_POS_SLIMIT 0x0F0008        /* cannot move on since it hits the joint's positive soft limit*/
#define JOINT_HIT_NEG_SLIMIT 0x0F0009        /* cannot move on since it hits the joint's negative soft limit*/
#define AXIS_EXCEED_POS_LIMIT 0x0F000A       /* the target position exceeds the axis positive limit*/
#define AXIS_EXCEED_NEG_LIMIT 0x0F000B       /* the target position exceeds the axis negative limit*/
#define JOG_UNSUPPORTED_WHEN_HOMING 0x0F000E /* cannot do jog operation when homing is in progress*/
#define INVALID_JOINT_NUM 0x0F000F           /* the commanded joint number is invalid*/
#define INVALID_VELOCITY 0x0F0010            /* the commanded velocity is invalid*/
#define TARGET_POS_EXCEED_LIMIT 0x0F0011     /* the target position exceeds the mechine's limits*/
#define HOME_IN_NONE_JOINT_MODE 0x0F0012     /* cannot do home operation since it's not in joint mode now*/
#define HOMING_ALRADY_IN_PROGRESS 0x0F0013   /* homing is already in pregress*/
#define EXIT_PROTECT_IN_WRONG_MODE 0x0F0014  /* failed to exit protective mode*/
#define ROBOT_NOT_TURNED_ON 0x0F0015         /* failed to do the operaion since the machine is now not turned on*/
#define ROBOT_ON_SOFT_LIMIT 0x0F0016         /* the mechine is now on soft limit*/
#define TARGET_POS_OUTOF_REACH 0x0F0017      /* the target position is out of reach*/
#define STOP_ON_SIGULARITY 0x0F0018          /* singularity pistion, protective stop*/
#define CAN_DEVICE_INIT_FAILED 0X0F0019      /* can device initialize failed*/
#define ONEKEY_UPGRADE_TIMEOUT 0x0F001A      /* onekey upgrade timeout*/
#define ONEKEY_UPGRADE_ERROR 0x0F001B        /* onekey upgrade err*/
#define ROBOT_POWER_ON_TIMEOUT 0x0F001D      /* robot power on timeout.*/

#define CANNOT_SWITCH_MODE_WHEN_PROGRAM_RUN 0x0F0090   /* switch mode when program is running*/
#define CANNOT_SWITCH_MODE_DURING_MOVEMENT 0x0F0091    /* switch mode when robot is in movement*/
#define CANNOT_TRIGGER_FUNCTION_IN_MANUALMODE 0x0F0092 /* cannot trigger this di function in manual mode*/
#define CANNOT_TRIGGER_FUNCTION_IN_AUTOMODE 0x0F0093   /* cannot trigger this di function in auto mode*/

#define CANNOT_SWITCH_MODE_IN_DRAG 0x0F0094                     /* switch mode when robot is in drag*/
#define CANNOT_TRIGGER_AUTO_RUN_PROGRAM_IN_MANUAL_MODE 0x0F0095 /* cannot trigger auto-run program in manual mode*/
#define CONFIG_ERROR_AUTO_RUN_PROGRAM_IN_MANUAL_MODE 0x0F0096   /*wrong configuration of auto-run program in auto-mode*/
#define CONFIG_ERROR_AUTO_RUN_PROGRAM 0x0F0097                  /*wrong configuration of auto-run program */
#define CANNOT_TRIGGER_AUTO_ENABLE_IN_MANUAL_MODE 0x0F0098      /* cannot trigger auto-enable in manual mode*/
#define CANNOT_EXECUTE_WHILE_ROBOT_POWERED_ON 0xF0099           /*The instruction cannot be executed while the robot is powered on.*/

#define CONFIG_FILE_WRONG_PARAMETERS 0X0F001C       /* wrong parameters in config file */
#define FAILED_TO_ADD_LINE 0x0F0020                 /* failed to move line to the target position*/
#define UNSUPPORTED_ROBOT_MODEL 0x0F0021            /* model of connected robot is now unsupported*/
#define INVALID_ROBOT_SERIAL_NUM 0x0F0022           /* invalid robot serial number*/
#define INVALID_IDENTIFY_TRAJ_INDEX 0x0F0023        /* invalid payload identification trajectory*/
#define CANNOT_SET_RAPIDRATE_IN_PERCENTAGE 0x0F0024 /* cannot set rapid rate in percentage mode*/
#define NONCOMPLIANT_IDENTIFY_TRAJ 0x0F0025         /* non-compliant identify trajectory*/
#define SERVO_OFF_BEFORE_POWER_OFF 0x0F0026         /* please servo off first before powering off the robot*/
#define CANNOT_SERVO_OFF_WHEN_PROG_RUN 0x0F0027     /* cannot disable the robot when a program is running*/
#define CANNOT_SERVO_ON_WHEN_TOR_OVERRUN 0x0F0028   /* cannot servo on the robot when servo torque overrun*/
#define FAILED_TO_ADD_MOVC 0x0F0029                 /* failed to add movc since three points are colinear*/

#define CANNOT_SWITCH_MODE_WHEN_PROGRAM_RUN 0x0F0090   /* switch mode when program is running*/
#define CANNOT_SWITCH_MODE_DURING_MOVEMENT 0x0F0091    /* switch mode when robot is in movement*/
#define CANNOT_TRIGGER_FUNCTION_IN_MANUALMODE 0x0F0092 /* cannot trigger this di function in manual mode*/
#define CANNOT_TRIGGER_FUNCTION_IN_AUTOMODE 0x0F0093   /* cannot trigger this di function in auto mode*/

#define ERROR_JOINT_VELOCITY_LIMIT_IS_ZERO 0X0F0030   //	joint velocity limit is zero	关节速度限制被设置为0
#define ERROR_THREE_POSITION_ENABLING_LIMIT 0X0F0031  //three position enabling limit con't JOG、debug or darg
#define CANNOT_TRACKING_FOR_THIS_MOTION 0x0F0032
#define SINGULARITY_PROTECTION 0x0F0033  // arrive sigularity position, protective stop
#define COLLISION_PROTECTION 0x0F0034    // collision detected, pretective stop
#define ATTITUDE_PROTECTION 0x0F0035     // attitude out of limit, pretective stop
#define EXCEED_MAX_TCP_MISMATCH 0x0F0036
#define EXCEED_MAX_TRAJ_SPEED 0x0F0037
#define FAILED_TO_ADD_JOINT_LINE 0x0F0038                            /* joint move cannot reach the target position*/
#define REPEATED_TEACH_POINTS 0x0F0039                               //tcp teach points are repeated
#define CANNOT_SERVO_OFF_WHEN_ROBOT_MOVING 0x0F003A                  //cannot disable servo when robot is moving
#define INFO_ROBOT_HAS_BEEN_POWERED_ON 0x0F003B                      // The robot has been powered on,
#define INFO_ROBOT_HAS_BEEN_ENABLED 0x0F003C                         // The robot has been enabled. There is no need to enable it again
#define TEACH_POINTS_COLLINEAR 0x0F003D                              // teach points are collinear
#define TCP_CALIBRATION_ERROR_TOO_BIG 0x0F003E                       // tcp calibration error is too big
#define TCP_CALIBRATION_POSITION_OVER_LIMIT 0x0F003F                 // tcp calibration position is over workspace limit
#define DRAG_CANNOT_ENABLE_ON_LIMIT 0x0F0040                         // cannot enter drag mode when beyond joint limit
#define DRAG_EXCEED_JOINT_LIMIT 0x0F0041                             // drag exceeding soft limit, it will quit drag mode
#define ERR_SET_ADMITTANCE_WHEN_FC_ON 0x0F0042                       //力控拖拽开启的时候不允许设置力控相关参数
#define CANNOT_DRAG_WHEN_SERVOOFF 0x0F0043                           // cannot enter drage mode when robot is disabled
#define CANNOT_DRAG_DURING_MOVEMENT 0x0F0044                         // cannot enter drage mode when robot is in movement
#define CANNOT_DRAG_WHEN_SERVOTOROVERRUN 0x0F0045                    // cannot enter drage mode when servo torque overrun
#define CANNOT_DRAG_WHEN_TURN_OFF_FREE_BUTTON 0x0F0046               // cannot enter drage mode when turn off tio free button
#define CANNOT_PAUSE_RESUME_PROG_WHEN_TURN_OFF_PROG_BUTTON 0x0F0047  //can not pause or resume program when turn off the button
#define CANNOT_RECORD_POINT_WHEN_TURN_OFF_POINT_BUTTON 0x0F0048      //can not record point when turn off the point button
#define DRAG_CANNOT_ENABLE_ON_SIM 0x0F0049                           // cannot enter drag mode when simmode
#define CANNOT_SET_BASE_COORDINATE_SYSTEM 0x0F004A                   // set coordinate system

#define ERR_REDUCE_ADMITTANCE_WHEN_FC_ON 0x0F004A  //程序力控开启的时候不允许减少力控方向

#define ADMIT_CANNOT_ENABLE_WITHOUT_SENSOR 0x0F0050  // cannot enable admittance control since sensor is not ready
#define ADMIT_CANNOT_SET_MODE_IN_OPERATION 0x0F0051  // cannot switch senor mode when in admittance control
#define SENSOR_FAULT_DURING_ADMITTANCE 0x0F0052      // torque sensor fault detected during admittance control
#define CANNOT_STEP_WHILE_RUNNING 0x0F0054           // cannot step while already executing
#define CANNOT_SET_COLLISION_SENSITIVITY 0x0F0055    // cannot set collision sensitivity in drag mode or force control mode
#define CANNOT_ACCESS_EXTIO_SINCE_OFFLINE 0x0F0056   // cannot access extio since it's not running
#define CANNOT_SET_TORQUE_FORWARD_OPTION 0x0F0057    // cannot set torque forward option when robot is moving
#define FUNCTION_IS_NOT_LICENCED 0x0F0058            // function is not licenced, please contact supplier
#define FAILED_RESET_PROTECTIVE_STOP 0x0F0059        // failed to reset safety guard
#define NONMANUAL_CANNOT_SET_ROBOT_SAFETY_PARAMETERS \
    0x0F005A  //The safety parameters cannot be configured if the robot is not in manual mode or in manual mode motion.
#define ENABLE_CANNOT_SET_ROBOT_SAFETY_PARAMETERS 0x0F005B           //safety parameter settings need to be disable
#define ABNORMAL_VALUES_OF_SAFETY_PARAMETERS 0x0F005C                //Abnormal values of safety parameters;
#define PROGRAM_EXECUTE_CANNOT_SET_ROBOT_SAFETY_PARAMETERS 0x0F005D  //The safety parameters cannot be configured if the program is being executed.
#define OUT_OF_RANGE_SET_SAFETY_PARAMETERS 0x0F005E                  //The safety parameters out of range.

#define CANNOT_SET_RAPIDRATE_IN_SAFETYGUARD 0x0F0060    // cannot set rapid rate in safety guard mode
#define USER_CALIBRATION_FAILED 0x0F0061                // user frame calibration failed
#define TIO_NO_CHN_FOR_TORQSNSOR 0x0F0062               // no tio rs485 channel is configured for torque sensor
#define TIO_MAX_ONE_CHN_FOR_TORQSNSOR 0x0F0063          // only one rs485 channel at most can be configured for torque sensor
#define TIO_ERR_SET_RSCOMM_WHEN_SNSOR_RUNNING 0x0F0064  // failed to change tio rs channle settings since a torque sensor is running
#define TIO_INVALID_SIGNAL_DEFINITION 0x0F0065          // invalid signal definition
#define TIO_SIGNAL_EXCEED_MAX_NUM 0x0F0066              // signals defined exceed the maximum numbers
#define TIO_SIGNAL_NOT_EXIST 0x0F0067                   // specified signal doesn't exist
#define TIO_RSCMD_QUEUE_FULL 0x0F0068                   // failed to send rs command since command queue was full
#define TIO_RSCMD_RESPONSE_TIMEOUT 0x0F0069             // tio rs485 command timeout

#define SERVO_DHPARAM_CRC_ERROR 0x0F0070         // invalid CRC of D-H parameters from servo side
#define SERVO_DYNPARAM_CRC_ERROR 0x0F0071        // invalid CRC of dynamics parameters from servo side
#define CAN_ENA_ROBOT_WHRN_READ_PARAMS 0x0F0072  // cannot enable robot when reading D-H or dynamics parameters from servo side
#define HIT_MOMENTUMLIMIT 0x0F0073               // robot velocity momentum exceed the limit 达到机器人动量限制       记录，弹窗，不停机
#define HIT_TCPVELOCITYLIMIT 0x0F0074            // robot tcp velocity exceed the limit 达到机器人TCP速度限制    记录，弹窗，不停机
#define HIT_SAFEZONELIMIT 0x0F0075               // robot is now nearby the safety zone 即将超出安全平面         记录，弹窗，不停机
#define SERVO_DHPARAM_VER_UNSUPPORTED 0x0F0076   // unsupported D-H parameter version from servo side
#define SERVO_DYNPARAM_VER_UNSUPPORTED 0x0F0077  // unsupported dynamics parameter version from servo side
#define SERVO_ENABLE_TOO_FREQUENTLY 0x0F0078     // servo enable too freequently
#define FAILED_SWITCH_SIM_IF_POWER_ON 0x0F0079   // cannot switch sim/real mode with power on

#define HIT_SAFEATTITUDELIMIT 0x0F007B   // robot is now nearby the safety attitude limit 即将超出姿态安全限制         记录，弹窗，不停机
#define FAILED_SWITCH_SIM_FAIL 0x0F007C  // cannot switch robot model with internal error

#define FAILED_SWITCH_ROBOT_MODEL_IF_POWER_ON 0x0F0080  // cannot switch robot model with power on
#define FAILED_TO_JOINT_DECELERATION 0x0F0083           // Joint deceleration failed 关节减速失败
#define ERROR_P1P2P3_COLINEAR 0x0F0084                  // ERROR: circular conveyor P1, P2 and P3 are colinear	圆形传送带P1,P2,P3三点共线
#define ERROR_NO_TRACKING_DIR 0x0F0085                  //linear conveyor tracking direction is zero	直线传送带跟踪方向为零
#define EEROR_GET_PAYLOAD_RESULT 0x0F0086               // 获取负载失败，建议重新辨识

#define ERROR_FAILED_TOPP 0x0F0087                     //failed to find feasiable sets when calculating controllable sets
#define ERROR_EXCEEDING_THE_MAXIMUM_DISTANCE 0x0F0094  //The robot exceeds the maximum distance that the conveyor belt tracks

#define EEROR_START_PAYLOAD_IDENTIFY 0x0F0088     // 侧装，倒装，暂不支持负载辨识
#define MOVS_NOT_SUPPORT_ESTOP_RECOVERY 0x0F0089  // 轨迹复现(movs)不知道急停后恢复程序运行

#define TIO_RSCMD_ERROR_CHN 0x0F008A  // failed to send rs command since this chnneal is only for torque sensor

#define FUNCTION_SAFTY_POWER_EXCEED_LIMIT 0x0F0100       //	robot power exceeds the limit	机器人功率超限
#define FUNCTION_SAFTY_MOMENTUM_EXCEED_LIMIT 0x0F0101    //	robot momentum exceeds the limit	机器人动量超限
#define FUNCTION_SAFTY_DECATED_COLLISION_BASE 0x0F0102   //	robot detectes collision by base sensor	底座传感器检测到碰撞
#define FUNCTION_SAFTY_DECATED_COLLISION_GM_J1 0x0F0103  //	End force excced the limit, collision detected by thr 1st joint	末端力超限，1轴检测到碰撞
#define FUNCTION_SAFTY_DECATED_COLLISION_GM_J2 0x0F0104  //	End force excced the limit, collision detected by thr 2nd joint	末端力超限，2轴检测到碰撞
#define FUNCTION_SAFTY_DECATED_COLLISION_GM_J3 0x0F0105  //	End force excced the limit, collision detected by thr 3rd joint	末端力超限，3轴检测到碰撞
#define FUNCTION_SAFTY_DECATED_COLLISION_GM_J4 0x0F0106  //	End force excced the limit, collision detected by thr 4th joint	末端力超限，4轴检测到碰撞
#define FUNCTION_SAFTY_DECATED_COLLISION_GM_J5 0x0F0107  //	End force excced the limit, collision detected by thr 5th joint	末端力超限，5轴检测到碰撞
#define FUNCTION_SAFTY_DECATED_COLLISION_GM_J6 0x0F0108  //	End force excced the limit, collision detected by thr 6th joint	末端力超限，6轴检测到碰撞
#define FUNCTION_SAFTY_PLANE_POINT_ERROR 0x0F0109  // safety plane point set error: no colinear or coincide is permitted,安全平面点设置错误：不允许共线或重合
#define DYNAMIC_SETTING_STATE_ERROR 0x0F0110  // cannot set servo dynamics parameters in poweroff state or enbale state, 设置动力学参数需要在上电下使能状态下
#define DYNAMIC_SETTING_PROCESS_ABORT 0x0F0111    // dynamcis parameters setting has been unnormally abort. 写动力学参数中断
#define DYNAMIC_SETTING_PROCESS_TIMEOUT 0x0F0112  // dynamcis parameters setting timeout. 写动力学参数超时
#define UNSUPPORTED_CABINET 0x0F0113              //不支持的控制柜类型
#define DYNAMIC_IDENTIFY_STATE_ERROR 0x0F0114     // cannot start idenitfy when disabled or poweroff. 无法在下使能状态下进行辨识
#define NET_CONFIG_READ_ERROR 0x0F0115            // read network ini failed 无法读取网络配置文件

// Addon Grpc Errorcode
#define EXCEPTION_SERVICE_NUM_CONSTRAINT 0x0F0116
#define EXCEPTION_SERVICE_NO_SUCH_ADDON_SERVICE 0x0F0117
#define EXCEPTION_SERVICE_GET_USEABLE_PORT_LIST_FAILED 0x0F0118
#define EXCEPTION_SERVICE_ALLOCATE_PORT_FAILED 0x0F0119
#define EXCEPTION_SERVICE_OPERATE_RUNNING_ADDON 0x0F011A
#define EXCEPTION_SERVICE_OPERATE_STOPPED_ADDON 0x0F011B
#define EXCEPTION_SERVICE_NO_SUC_ADDON_CTRL_CMD 0x0F011C
#define EXCEPTION_SERVICE_BUILTINADDON_PORT_DUPLICATED 0x0F011D
#define EXCEPTION_SERVICE_BUILTINADDON_OP_FAILED 0x0F011F
#define EXCEPTION_SERVICE_OPERATE_INVALID_ADDON 0x0F0120

#define EXCEPTION_SERVICE_CONFIG_FILE_INVALID 0x0F0121
#define EXCEPTION_SERVICE_CONFIG_FILE_MISS_REQUIRED 0x0F0122
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_PORT 0x0F0123
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_LANGUAGE 0x0F0124
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_TYPE 0x0F0125
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_SERVICEENABLE 0x0F0126
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_SERVICE 0x0F0127
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_NAME 0x0F0128
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_DESCRIPTION 0x0F0129
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_URL 0x0F012A
#define EXCEPTION_SERVICE_CONFIG_FILE_ERR_CONVENTION 0x0F012B

#define EXCEPTION_SERVICE_INSTALL_PACKAGE_NOT_EXIST 0x0F012C
#define EXCEPTION_SERVICE_INSTALL_PACKAGE_MOVE_FAILED 0x0F012D
#define EXCEPTION_SERVICE_INSTALL_PACKAGE_UNCOMPRESS_FAILED 0x0F012E
#define EXCEPTION_SERVICE_INSTALL_PACKAGE_THREAD_IS_BUSY 0x0F012F
#define EXCEPTION_SERVICE_INSTALL_PACKAGE_NO_INSTALL_TASK 0x0F0130
#define EXCEPTION_SERVICE_INSTALL_PACKAGE_COMPRESS_FAILED 0x0F0131
#define EXCEPTION_SERVICE_INSTALL_PACKAGE_TIMEOUT 0x0F0132
#define EXCEPTION_SERVICE_INSTALL_PACKAGE_WRONG_FORMAT 0x0F0133

#define SENSOR_OVER_SOFTLIMIT 0x0F0140  // exceed soft limit 超过设定软限位
#define SENSOR_OUTOFRANGE 0x0F0141      // exceed measure range 超过传感器最大量程

#define ERROR_QUERY_SCB_HARDWARE_MODEL_FAILED 0x0F0150          // Query the SCB hardware model failed  询问请求SCB硬件型号失败
#define ERROR_SETTING_SCB_SAFETY_FUNCDI_CONFIG_FAILED 0x0F0151  // Setting the SCB safety function DI configuration failed  设置SCB安全功能DI配置失败
#define ERROR_SETTING_SCB_SAFETY_FUNCDO_CONFIG_FAILED 0x0F0152  // Setting the SCB safety function DO configuration failed  设置SCB安全功能DO配置失败
#define ERROR_SETTING_SCB_POWER_LIMIT_CONFIG_FAILED 0x0F0153    // Setting the SCB power limit configuration failed  设置SCB功率限制配置失败
#define ERROR_SETTING_SCB_TCP_OFFSET_CONFIG_FAILED 0x0F0154     // Setting the SCB TCP offset configuration failed   设置SCB工具坐标系配置失败
#define ERROR_SETTING_SCB_CAB_ID_CONFIG_FAILED 0x0F0155         // Setting the SCB cab id configuration failed   设置控制柜序列号配置失败
#define ERROR_SETTING_SCB_CAB_VOLTAGE_CONFIG_FAILED 0x0F0156    // Setting the SCB cab voltage configuration failed   设置控制柜输出电压配置失败
#define ERROR_SETTING_SCB_STOPPING_TIME_CONFIG_FAILED 0x0F0157  // Setting the SCB stopping time configuration failed   设置SCB停止时间配置失败
#define ERROR_SETTING_SCB_STOPPING_DISTANCE_CONFIG_FAILED 0x0F0158  // Setting the SCB stopping distance configuration failed   设置SCB停止距离配置失败
#define ERROR_SETTING_SCB_DRAG_TCP_VEL_LIMIT_CONFIG_FAILED 0x0F0159  //Setting the SCB drag tcp velocity limit configuration failed

#define ROBOT_SAFETY_LIMIT_CONFLICT_WITH_REDUCED_SAFETY_LIMIT 0x0F0170  //The robot momentum limit conflict with the reduced mode momentum limit

#define JOINT_EXCEED_VEL_LIMIT_J1 0x000030 /* joint 1 velocity exceed the limit*/
#define JOINT_EXCEED_VEL_LIMIT_J2 0x010030 /* joint 2 velocity exceed the limit*/
#define JOINT_EXCEED_VEL_LIMIT_J3 0x020030 /* joint 3 velocity exceed the limit*/
#define JOINT_EXCEED_VEL_LIMIT_J4 0x030030 /* joint 4 velocity exceed the limit*/
#define JOINT_EXCEED_VEL_LIMIT_J5 0x040030 /* joint 5 velocity exceed the limit*/
#define JOINT_EXCEED_VEL_LIMIT_J6 0x050030 /* joint 6 velocity exceed the limit*/
#define JOINT_HIT_POS_SLIMIT_J1 0x000031   /* hits the joint 1's positive soft limit*/
#define JOINT_HIT_POS_SLIMIT_J2 0x010031   /* hits the joint 2's positive soft limit*/
#define JOINT_HIT_POS_SLIMIT_J3 0x020031   /* hits the joint 3's positive soft limit*/
#define JOINT_HIT_POS_SLIMIT_J4 0x030031   /* hits the joint 4's positive soft limit*/
#define JOINT_HIT_POS_SLIMIT_J5 0x040031   /* hits the joint 5's positive soft limit*/
#define JOINT_HIT_POS_SLIMIT_J6 0x050031   /* hits the joint 6's positive soft limit*/
#define JOINT_HIT_NEG_SLIMIT_J1 0x000032   /* hits the joint 1's negative soft limit*/
#define JOINT_HIT_NEG_SLIMIT_J2 0x010032   /* hits the joint 2's negative soft limit*/
#define JOINT_HIT_NEG_SLIMIT_J3 0x020032   /* hits the joint 3's negative soft limit*/
#define JOINT_HIT_NEG_SLIMIT_J4 0x030032   /* hits the joint 4's negative soft limit*/
#define JOINT_HIT_NEG_SLIMIT_J5 0x040032   /* hits the joint 5's negative soft limit*/
#define JOINT_HIT_NEG_SLIMIT_J6 0x050032   /* hits the joint 6's negative soft limit*/

#define JOINT_ABOUT_HIT_POS_SLIMIT_J1 0x000033 /* ABOUT hits the joint 1's positive soft limit : pre_check*/
#define JOINT_ABOUT_HIT_POS_SLIMIT_J2 0x010033 /* ABOUT hits the joint 2's positive soft limit : pre_check*/
#define JOINT_ABOUT_HIT_POS_SLIMIT_J3 0x020033 /* ABOUT hits the joint 3's positive soft limit : pre_check*/
#define JOINT_ABOUT_HIT_POS_SLIMIT_J4 0x030033 /* ABOUT hits the joint 4's positive soft limit : pre_check*/
#define JOINT_ABOUT_HIT_POS_SLIMIT_J5 0x040033 /* ABOUT hits the joint 5's positive soft limit : pre_check*/
#define JOINT_ABOUT_HIT_POS_SLIMIT_J6 0x050033 /* ABOUT hits the joint 6's positive soft limit : pre_check*/
#define JOINT_ABOUT_HIT_NEG_SLIMIT_J1 0x000034 /* ABOUT hits the joint 1's negative soft limit : pre_check*/
#define JOINT_ABOUT_HIT_NEG_SLIMIT_J2 0x010034 /* ABOUT hits the joint 2's negative soft limit : pre_check*/
#define JOINT_ABOUT_HIT_NEG_SLIMIT_J3 0x020034 /* ABOUT hits the joint 3's negative soft limit : pre_check*/
#define JOINT_ABOUT_HIT_NEG_SLIMIT_J4 0x030034 /* ABOUT hits the joint 4's negative soft limit : pre_check*/
#define JOINT_ABOUT_HIT_NEG_SLIMIT_J5 0x040034 /* ABOUT hits the joint 5's negative soft limit : pre_check*/
#define JOINT_ABOUT_HIT_NEG_SLIMIT_J6 0x050034 /* ABOUT hits the joint 6's negative soft limit : pre_check*/

#define JOG_TARGET_EXCEED_POS_SLIMIT_J1 0x000035 /* cannot jog joint 1 further past max soft limit */
#define JOG_TARGET_EXCEED_POS_SLIMIT_J2 0x010035 /* cannot jog joint 2 further past max soft limit.*/
#define JOG_TARGET_EXCEED_POS_SLIMIT_J3 0x020035 /* cannot jog joint 3 further past max soft limit.*/
#define JOG_TARGET_EXCEED_POS_SLIMIT_J4 0x030035 /* cannot jog joint 4 further past max soft limit.*/
#define JOG_TARGET_EXCEED_POS_SLIMIT_J5 0x040035 /* cannot jog joint 5 further past max soft limit.*/
#define JOG_TARGET_EXCEED_POS_SLIMIT_J6 0x050035 /* cannot jog joint 6 further past max soft limit.*/
#define JOG_TARGET_EXCEED_NEG_SLIMIT_J1 0x000036 /* cannot jog joint 1 further past min soft limit */
#define JOG_TARGET_EXCEED_NEG_SLIMIT_J2 0x010036 /* cannot jog joint 2 further past min soft limit.*/
#define JOG_TARGET_EXCEED_NEG_SLIMIT_J3 0x020036 /* cannot jog joint 3 further past min soft limit.*/
#define JOG_TARGET_EXCEED_NEG_SLIMIT_J4 0x030036 /* cannot jog joint 4 further past min soft limit.*/
#define JOG_TARGET_EXCEED_NEG_SLIMIT_J5 0x040036 /* cannot jog joint 5 further past min soft limit.*/
#define JOG_TARGET_EXCEED_NEG_SLIMIT_J6 0x050036 /* cannot jog joint 6 further past min soft limit.*/
#define JOINT_EXCEED_ACCELERATION_J1 0x000037    /* Joint 1 acceleration too high*/
#define JOINT_EXCEED_ACCELERATION_J2 0x010037    /* Joint 2 acceleration too high*/
#define JOINT_EXCEED_ACCELERATION_J3 0x020037    /* Joint 3 acceleration too high*/
#define JOINT_EXCEED_ACCELERATION_J4 0x030037    /* Joint 4 acceleration too high*/
#define JOINT_EXCEED_ACCELERATION_J5 0x040037    /* Joint 5 acceleration too high*/
#define JOINT_EXCEED_ACCELERATION_J6 0x050037    /* Joint 6 acceleration too high*/
#define DRAG_NEARBY_SOFT_LIMIT_J1 0x000042       // joint 1 is now nearby the soft limit
#define DRAG_NEARBY_SOFT_LIMIT_J2 0x010042       // joint 2 is now nearby the soft limit
#define DRAG_NEARBY_SOFT_LIMIT_J3 0x020042       // joint 3 is now nearby the soft limit
#define DRAG_NEARBY_SOFT_LIMIT_J4 0x030042       // joint 4 is now nearby the soft limit
#define DRAG_NEARBY_SOFT_LIMIT_J5 0x040042       // joint 5 is now nearby the soft limit
#define DRAG_NEARBY_SOFT_LIMIT_J6 0x050042       // joint 6 is now nearby the soft limit
#define COLLISION_PROTECTION_J1 0x000061         // pretective stop since collision detected on joint 1
#define COLLISION_PROTECTION_J2 0x010061         // pretective stop since collision detected on joint 2
#define COLLISION_PROTECTION_J3 0x020061         // pretective stop since collision detected on joint 3
#define COLLISION_PROTECTION_J4 0x030061         // pretective stop since collision detected on joint 4
#define COLLISION_PROTECTION_J5 0x040061         // pretective stop since collision detected on joint 5
#define COLLISION_PROTECTION_J6 0x050061         // pretective stop since collision detected on joint 6
/*********************************errors related to online command (end)**************************************/

#define TIO_ERR_CONNECT_ERR 0x201002  // TIO connection error

/*********************************errors related to servo side (start)****************************************/
#define DRIVE_ENABLE_TIMEOUT 0x0F1001         // servo enable timeout
#define DRIVE_QUERY_VERSION_TIMEOUT 0x0F1002  // query servo version timeout
#define DRIVE_ERR_CONNECT_ERR_J1 0x001002     // joint 1 CAN connection error
#define DRIVE_ERR_CONNECT_ERR_J2 0x011002     // joint 2 connection error
#define DRIVE_ERR_CONNECT_ERR_J3 0x021002     // joint 3 connection error
#define DRIVE_ERR_CONNECT_ERR_J4 0x031002     // joint 4 connection error
#define DRIVE_ERR_CONNECT_ERR_J5 0x041002     // joint 5 connection error
#define DRIVE_ERR_CONNECT_ERR_J6 0x051002     // joint 6 connection error

#define JOINT_AMPLIFIER_FAULT_J1 0x001003  // joint amplifier fault detected
#define JOINT_AMPLIFIER_FAULT_J2 0x011003  // joint amplifier fault detected
#define JOINT_AMPLIFIER_FAULT_J3 0x021003  // joint amplifier fault detected
#define JOINT_AMPLIFIER_FAULT_J4 0x031003  // joint amplifier fault detected
#define JOINT_AMPLIFIER_FAULT_J5 0x041003  // joint amplifier fault detected
#define JOINT_AMPLIFIER_FAULT_J6 0x051003  // joint amplifier fault detected
#define JOINT_FOLLOWING_ERROR_J1 0x001004  // joint 1 following error detected
#define JOINT_FOLLOWING_ERROR_J2 0x011004  // joint 2 following error detected
#define JOINT_FOLLOWING_ERROR_J3 0x021004  // joint 3 following error detected
#define JOINT_FOLLOWING_ERROR_J4 0x031004  // joint 4 following error detected
#define JOINT_FOLLOWING_ERROR_J5 0x041004  // joint 5 following error detected
#define JOINT_FOLLOWING_ERROR_J6 0x051004  // joint 6 following error detected
/*********************************errors related to servo side (end)***************************************/

/*********************************errors related to program (start)****************************************/
#define PROGRAM_INVALID_SYNTAX 0x0F2000        /*syntax error detected in the program file*/
#define PROGRAM_FILE_NOT_OPEN 0x0F2001         /*no program file is opened*/
#define PROGRAM_FILE_FAILED_OPEN 0x0F2002      /*failed to open the program file*/
#define PROGRAM_FILE_FAILED_CLOSE 0x0F2003     /*failed to close the program file*/
#define PROGRAM_FILE_BACKUP_SUCCESSED 0x0F2004 /*successed to backup program file*/
#define PROGRAM_FILE_BACKUP_FAILED 0x0F2005    /*failed to backup program file*/

/*######  F2010 ~ F21FF   为脚本指令错误，APP 检测到这些错误码报错信息中的文件名和行号，会显示跳转按钮，支持跳转到出错的指令**/
#define INTERP_ERR_TEMP 0x0F2010
#define INTERP_ERR_PYCALL_FAILED 0x0F2011
#define INTERP_ERR_ASSERT_FAILED 0x0F2012
#define INTERP_ERR_ZERO_RADIUS_ARC 0x0F2013
#define INTERP_ERR_SYNTAX_FAILED 0x0F2014
#define INTERP_ERR_SOCKET_CREATE 0x0F2015                   /*failed to create the socket*/
#define INTERP_ERR_SOCKET_CONNECT 0x0F2016                  /*failed to connect the server*/
#define INTERP_ERR_SOCKET_NO_CONNECT 0x0F2017               /*communication failure, since no connection is established*/
#define INTERP_ERR_SOCKET_RECV_DATA 0x0F2018                /*failed to received from camera!*/
#define INTERP_ERR_SOCKET_SEND_DATA 0x0F2019                /*failed to send data to the server*/
#define INTERP_ERR_LOAD_2D_CFG 0x0F201A                     /*load 2D Vision config failed!*/
#define INTERP_ERR_INTERNAL 0x0F201B                        /*internal error*/
#define INTERP_ERR_PARAMETER_NOT_TERMINATED 0x0F201C        /*Named parameter not terminated*/
#define INTERP_ERR_EOF_NO_PERCENT_SIGN 0x0F201D             /*File ended with no percent sign or program end*/
#define INTERP_ERR_INVALID_P_WORD 0x0F201E                  /*invalid P-word with M66*/
#define INTERP_ERR_UNKNOWN_MOTION_CODE 0x0F201F             /*unknown motion code*/
#define INTERP_ERR_INDEX_INCORRECT_AXIS 0x0F2020            /*trying to index incorrect axis*/
#define INTERP_ERR_FUNCTION_NOT_CALLED 0x0F2021             /*function should not have been called*/
#define INTERP_ERR_UNKNOWN_OPERATION 0x0F2022               /*unknown operation*/
#define INTERP_ERR_BAD_NUMBER_FORMAT 0x0F2023               /*bad number format*/
#define INTERP_ERR_PARAMETER_NOT_DEFINED 0x0F2024           /*parameter not defined*/
#define INTERP_ERR_OPEN_FILE_FAILED 0x0F2025                /*open file failed*/
#define INTERP_ERR_KEY_NOT_FOUND_IN_INI 0x0F2026            /*key not found in INI file*/
#define INTERP_ERR_OUT_OF_MEMORY 0x0F2027                   /*Out of memory*/
#define INTERP_ERR_RETURN_VALUE_TYPE 0x0F2028               /*Error of return value type*/
#define INTERP_ERR_TOO_MANY_SUBROUTINE_LEVELS 0x0F2029      /*Too many subroutine levels*/
#define INTERP_ERR_CANNOT_ADD_PARAMETER 0x0F202A            /*can not add parameter*/
#define INTERP_ERR_USER_DEFINED 0x0F202B                    /*user defined error*/
#define INTERP_ERR_NON_INTEGER_FOR_INTEGER 0x0F202C         /*non integer value for integer*/
#define INTERP_ERR_UNEXPECT_CHARACTER_AFTER_O_WORD 0x0F202D /*unexpect character after o-word*/
#define INTERP_ERR_UNKNOWN_OPERATION_NAME_STARTING 0x0F202E /*Unknown operation name starting */
#define INTERP_ERR_UNCLOSED_EXPRESSION 0x0F202F             /*unclosed expression*/
#define INTERP_ERR_UNKNOWN_WORD_STARTING 0x0F2030           /*Unknown word starting*/
#define INTERP_ERR_UNKNOWN_WORD_UNARY_OPERATION 0x0F2031    /*Unknown word where unary operation could be*/
#define INTERP_ERR_UNKNOWN_COMMAND_IN_O_LINE 0x0F2032       /*Unknown control command in o word*/
#define INTERP_ERR_COMMAND_TOO_LONG 0x0F2033                /*Command too long*/
#define INTERP_ERR_PARAMETER_FILE_OUTOF_ORDER 0x0F2034      /*Parameter file out of order*/
#define INTERP_ERR_UNHANDLED_INDEX 0x0F2035                 /*unhandled index*/
#define INTERP_ERR_FILE_NOT_OPENED 0x0F2036                 /*file not opened*/
#define INTERP_ERR_REDEFINITION 0x0F2037                    /*redefined*/
#define INTERP_ERR_UNKNOWN_OWORD_NUMBER 0x0F2038            /*Unknown o-word number*/
#define INTERP_ERR_CANNOT_REOPEN_FILE 0x0F2039              /*can not reopen file*/
#define INTERP_ERR_UNMATCHED_END 0x0F203A                   /*An unmatched 'end' keyword exists in the script*/

#define INTERP_ERR_TOO_MANY_THREAD 0x0F203B           /* too  many thread has been created*/
#define INTERP_ERR_THREAD_IS_RUNNING 0x0F203C         /* create thread * failed, thread * is running */
#define INTERP_ERR_UNMATCHED_ELIF 0x0F203D            /* unmatched control oword elif */
#define INTERP_ERR_UNMATCHED_ELSE 0x0F203E            /* unmatched control oword else */
#define INTERP_ERR_UNMATCHED_BREAK 0x0F203F           /* unmatched control oword break */
#define INTERP_ERR_UNMATCHED_CONTINUE 0x0F2040        /* unmatched control oword continue */
#define INTERP_ERR_UNMATCHED_RETURN 0x0F2041          /* unmatched control oword return */
#define INTERP_ERR_READ_TIO_SIGNAL_FAILED 0x0F2042    /*read tio signal failed, undefined signal SIG_NAME */
#define INTERP_ERR_SET_USER_DEFINED_VARIABLE 0x0F2043 /* set user defined variable failed, index out of range*/
#define INTERP_ERR_TIO_SIGNAL_MISS 0x0F2044           /*read tio signal failed, signal value miss */

#define INTERP_ERR_SOCK_INVALIDID 0x0F2050                  /*invalid socket id*/
#define INTERP_ERR_INVERSE_FAILED 0x0F2051                  /*inverse kinematics error*/
#define INTERP_ERR_FORWARD_FAILED 0x0F2052                  /*forward kinematics error*/
#define INTERP_ERR_RECV_WRONG_DATA 0x0F2053                 /*wrong data received via tcp/ip connection*/
#define INTERP_ERR_INVALID_ARRAY 0x0F2054                   /*invalid array variable*/
#define INTERP_ERR_INVALID_INDEX 0x0F2055                   /*invalid array element index*/
#define INTERP_ERR_INVALID_INTPL_RATIO 0x0F2056             /*invalid parameter*/
#define INTERP_ERR_UNMATCHED_STATMENT_END 0x0F2057          /*unmatched control oword end*/
#define INTERP_ERR_UNSUPPORTED_ESC_CHARATER 0x0F2058        /*unsupported escape characters*/
#define INTERP_ERR_INVALID_ARRAY_SLICE_STEP 0x0F2059        /*invalid array slice step*/
#define INTERP_ERR_ARRAY_NEST_UNSUPPORT 0x0F2060            /*usage of nesting array is not supported*/
#define INTERP_ERR_STRING_ARRAY_UNSUPPORT 0x0F2061          /*string array is not supported*/
#define INTERP_ERR_TOO_MANY_SOCKET 0x0F2062                 /*too many sockets are allocated*/
#define INTERP_WARNING_SOCKET_RECV_INVALID_DATA 0x0F2063    /*Socket received data is invalid	socket 接收的数据无效*/
#define INTERP_WARNING_SOCKET_UNMATCHED_ARRAY_SIZE 0x0F2064 /* Socket received an array with unmathed size   Socket 接收到的数组长度不匹配*/
#define INTERP_WARNING_SOCKET_UNMATCHED_DATA_TYPE 0x0F2065 /* Socket received a paramater with unmathed data type.    Socket 接收到的数据类型不匹配*/
#define INTERP_WARNING_DISABLEED_FUNCTION 0x0F2066         /* disabled function.    未启用的功能*/
#define INTERP_ERR_DATA_TYPE 0x0F2067                      /*Cannot compare different types of data     无法比较不同类型的数据*/
#define INTERP_EXECUTION_ERROR 0x0F2068                    /*Program execution error.*/

/*######  F2010 ~ F21FF   为脚本指令错误，APP 检测到这些错误码报错信息中的文件名和行号，会显示跳转按钮，支持跳转到出错的指令**/
/*********************************errors related to program (end)****************************************/

/*******************************2D/3D vision (start)*****************************/
#define VISION_CONNECT_FAILED 0x0F3001       // failed to connect with specified camera
#define VISION_NO_DEVICE_CONNECTED 0x0F3002  // no visual device is now connected
/*******************************2D/3D vision (end)*******************************/

/*******************************HARDWARE module (start)**************************/
#define CAN_MASTER_SERVO_MODE_ERROR 0x0F4001         // servo state machine error
#define SERVO_FIRMWARE_UPGRADE_ERROR 0x0F4002        // failed to upgrade servo firmware
#define FUNCTION_NOT_SUPPORTED_BY_HARDWARE 0x0F4003  // hardware doesn't support this function
#define SERVO_ENCODE_ERROR 0x0F4004                  //伺服编码器异常，提示用户点检
/*******************************HARDWARE module (end)****************************/

// 电流环控制报错
#define ERROR_ENTER_TORQUE_CONTROL_WHILE_OFF 0x0F5001     // 未上使能，无法进入力矩控制模式
#define ERROR_ENTER_TORQUE_CONTROL_WHILE_MOVING 0x0F5002  // 机器人运动中，无法进入力矩控制模式

/*******************************errors from servo side (start)*********************************/

#define DRIVE_ERR_DC_OVERCURRENT_J1 0x102230  // 关节1母线过流
#define DRIVE_ERR_DC_OVERCURRENT_J2 0x112230  // 关节2母线过流
#define DRIVE_ERR_DC_OVERCURRENT_J3 0x122230  // 关节3母线过流
#define DRIVE_ERR_DC_OVERCURRENT_J4 0x132230  // 关节4母线过流
#define DRIVE_ERR_DC_OVERCURRENT_J5 0x142230  // 关节5母线过流
#define DRIVE_ERR_DC_OVERCURRENT_J6 0x152230  // 关节6母线过流

#define DRIVE_ERR_PHASE_OVERCURRENT_J1 0x102320  // joint 1 phase current over limit
#define DRIVE_ERR_PHASE_OVERCURRENT_J2 0x112320  // joint 2 phase current over limit
#define DRIVE_ERR_PHASE_OVERCURRENT_J3 0x122320  // joint 3 phase current over limit
#define DRIVE_ERR_PHASE_OVERCURRENT_J4 0x132320  // joint 4 phase current over limit
#define DRIVE_ERR_PHASE_OVERCURRENT_J5 0x142320  // joint 5 phase current over limit
#define DRIVE_ERR_PHASE_OVERCURRENT_J6 0x152320  // joint 6 phase current over limit

#define DRIVE_ERR_ATUNE_OVERCURRENT_J1 0x102321  // joint 1 auto tune current over limit
#define DRIVE_ERR_ATUNE_OVERCURRENT_J2 0x112321  // joint 2 auto tune current over limit
#define DRIVE_ERR_ATUNE_OVERCURRENT_J3 0x122321  // joint 3 auto tune current over limit
#define DRIVE_ERR_ATUNE_OVERCURRENT_J4 0x132321  // joint 4 auto tune current over limit
#define DRIVE_ERR_ATUNE_OVERCURRENT_J5 0x142321  // joint 5 auto tune current over limit
#define DRIVE_ERR_ATUNE_OVERCURRENT_J6 0x152321  // joint 6 auto tune current over limit

#define DRIVE_ERR_SAME_DIR_OVERSPD_J1 0x108480  // joint 1 same direction over speed
#define DRIVE_ERR_SAME_DIR_OVERSPD_J2 0x118480  // joint 2 same direction over speed
#define DRIVE_ERR_SAME_DIR_OVERSPD_J3 0x128480  // joint 3 same direction over speed
#define DRIVE_ERR_SAME_DIR_OVERSPD_J4 0x138480  // joint 4 same direction over speed
#define DRIVE_ERR_SAME_DIR_OVERSPD_J5 0x148480  // joint 5 same direction over speed
#define DRIVE_ERR_SAME_DIR_OVERSPD_J6 0x158480  // joint 6 same direction over speed

#define DRIVE_ERR_REV_DIR_OVERSPD_J1 0x108481  // joint 1 reverse direction over speed
#define DRIVE_ERR_REV_DIR_OVERSPD_J2 0x118481  // joint 2 reverse direction over speed
#define DRIVE_ERR_REV_DIR_OVERSPD_J3 0x128481  // joint 3 reverse direction over speed
#define DRIVE_ERR_REV_DIR_OVERSPD_J4 0x138481  // joint 4 reverse direction over speed
#define DRIVE_ERR_REV_DIR_OVERSPD_J5 0x148481  // joint 5 reverse direction over speed
#define DRIVE_ERR_REV_DIR_OVERSPD_J6 0x158481  // joint 6 reverse direction over speed

#define DRIVE_ERR_OVER_MAX_SPD_J1 0x108482  // joint 1 over max speed
#define DRIVE_ERR_OVER_MAX_SPD_J2 0x118482  // joint 2 over max speed
#define DRIVE_ERR_OVER_MAX_SPD_J3 0x128482  // joint 3 over max speed
#define DRIVE_ERR_OVER_MAX_SPD_J4 0x138482  // joint 4 over max speed
#define DRIVE_ERR_OVER_MAX_SPD_J5 0x148482  // joint 5 over max speed
#define DRIVE_ERR_OVER_MAX_SPD_J6 0x158482  // joint 6 over max speed

#define DRIVE_ERR_SPD_LAG_ERR_J1 0x108483  // joint 1 speed err too large
#define DRIVE_ERR_SPD_LAG_ERR_J2 0x118483  // joint 2 speed err too large
#define DRIVE_ERR_SPD_LAG_ERR_J3 0x128483  // joint 3 speed err too large
#define DRIVE_ERR_SPD_LAG_ERR_J4 0x138483  // joint 4 speed err too large
#define DRIVE_ERR_SPD_LAG_ERR_J5 0x148483  // joint 5 speed err too large
#define DRIVE_ERR_SPD_LAG_ERR_J6 0x158483  // joint 6 speed err too large

#define DRIVE_ERR_OVER_MAX_ACC_J1 0x108484  // joint 1 加速度超差
#define DRIVE_ERR_OVER_MAX_ACC_J2 0x118484  // joint 2 加速度超差
#define DRIVE_ERR_OVER_MAX_ACC_J3 0x128484  // joint 3 加速度超差
#define DRIVE_ERR_OVER_MAX_ACC_J4 0x138484  // joint 4 加速度超差
#define DRIVE_ERR_OVER_MAX_ACC_J5 0x148484  // joint 5 加速度超差
#define DRIVE_ERR_OVER_MAX_ACC_J6 0x158484  // joint 6 加速度超差

#define DRIVE_ERR_SPD_STALL_ERR_J1 0x108485  // joint 1 speed stall error
#define DRIVE_ERR_SPD_STALL_ERR_J2 0x118485  // joint 2 speed stall error
#define DRIVE_ERR_SPD_STALL_ERR_J3 0x128485  // joint 3 speed stall error
#define DRIVE_ERR_SPD_STALL_ERR_J4 0x138485  // joint 4 speed stall error
#define DRIVE_ERR_SPD_STALL_ERR_J5 0x148485  // joint 5 speed stall error
#define DRIVE_ERR_SPD_STALL_ERR_J6 0x158485  // joint 6 speed stall error

#define DRIVE_ERR_ENC_TIMEOUT_J1 0x107380  // joint 1 encoder connetion time out
#define DRIVE_ERR_ENC_TIMEOUT_J2 0x117380  // joint 2 encoder connetion time out
#define DRIVE_ERR_ENC_TIMEOUT_J3 0x127380  // joint 3 encoder connetion time out
#define DRIVE_ERR_ENC_TIMEOUT_J4 0x137380  // joint 4 encoder connetion time out
#define DRIVE_ERR_ENC_TIMEOUT_J5 0x147380  // joint 5 encoder connetion time out
#define DRIVE_ERR_ENC_TIMEOUT_J6 0x157380  // joint 6 encoder connetion time out

#define DRIVE_ERR_ENC_BATTERY_ALM_J1 0x107381  // joint 1 编码器电池欠压
#define DRIVE_ERR_ENC_BATTERY_ALM_J2 0x117381  // joint 2 编码器电池欠压
#define DRIVE_ERR_ENC_BATTERY_ALM_J3 0x127381  // joint 3 编码器电池欠压
#define DRIVE_ERR_ENC_BATTERY_ALM_J4 0x137381  // joint 4 编码器电池欠压
#define DRIVE_ERR_ENC_BATTERY_ALM_J5 0x147381  // joint 5 编码器电池欠压
#define DRIVE_ERR_ENC_BATTERY_ALM_J6 0x157381  // joint 6 编码器电池欠压

#define DRIVE_ERR_ENC_BATTERY_ERR_J1 0x107382  // joint 1 编码器电池断开
#define DRIVE_ERR_ENC_BATTERY_ERR_J2 0x117382  // joint 2 编码器电池断开
#define DRIVE_ERR_ENC_BATTERY_ERR_J3 0x127382  // joint 3 编码器电池断开
#define DRIVE_ERR_ENC_BATTERY_ERR_J4 0x137382  // joint 4 编码器电池断开
#define DRIVE_ERR_ENC_BATTERY_ERR_J5 0x147382  // joint 5 编码器电池断开
#define DRIVE_ERR_ENC_BATTERY_ERR_J6 0x157382  // joint 6 编码器电池断开

#define DRIVE_ERR_ENC_EEPROM_ERR_J1 0x107383  // joint 1 编码器存储角度错误
#define DRIVE_ERR_ENC_EEPROM_ERR_J2 0x117383  // joint 2 编码器存储角度错误
#define DRIVE_ERR_ENC_EEPROM_ERR_J3 0x127383  // joint 3 编码器存储角度错误
#define DRIVE_ERR_ENC_EEPROM_ERR_J4 0x137383  // joint 4 编码器存储角度错误
#define DRIVE_ERR_ENC_EEPROM_ERR_J5 0x147383  // joint 5 编码器存储角度错误
#define DRIVE_ERR_ENC_EEPROM_ERR_J6 0x157383  // joint 6 编码器存储角度错误

#define DRIVE_ERR_ENC_COUNT_ERR_J1 0x107384  // joint 1 encoder count error
#define DRIVE_ERR_ENC_COUNT_ERR_J2 0x117384  // joint 2 encoder count error
#define DRIVE_ERR_ENC_COUNT_ERR_J3 0x127384  // joint 3 encoder count error
#define DRIVE_ERR_ENC_COUNT_ERR_J4 0x137384  // joint 4 encoder count error
#define DRIVE_ERR_ENC_COUNT_ERR_J5 0x147384  // joint 5 encoder count error
#define DRIVE_ERR_ENC_COUNT_ERR_J6 0x157384  // joint 6 encoder count error

#define DRIVE_ERR_ENC_DUAL_ERR_J1 0x107385  // joint 1 双编码器校验错误
#define DRIVE_ERR_ENC_DUAL_ERR_J2 0x117385  // joint 2 双编码器校验错误
#define DRIVE_ERR_ENC_DUAL_ERR_J3 0x127385  // joint 3 双编码器校验错误
#define DRIVE_ERR_ENC_DUAL_ERR_J4 0x137385  // joint 4 双编码器校验错误
#define DRIVE_ERR_ENC_DUAL_ERR_J5 0x147385  // joint 5 双编码器校验错误
#define DRIVE_ERR_ENC_DUAL_ERR_J6 0x157385  // joint 6 双编码器校验错误

#define DRIVE_ERR_ENC_Z_MISS_J1 0x107387  // joint 1 Z线捕捉故障
#define DRIVE_ERR_ENC_Z_MISS_J2 0x117387  // joint 2 Z线捕捉故障
#define DRIVE_ERR_ENC_Z_MISS_J3 0x127387  // joint 3 Z线捕捉故障
#define DRIVE_ERR_ENC_Z_MISS_J4 0x137387  // joint 4 Z线捕捉故障
#define DRIVE_ERR_ENC_Z_MISS_J5 0x147387  // joint 5 Z线捕捉故障
#define DRIVE_ERR_ENC_Z_MISS_J6 0x157387  // joint 6 Z线捕捉故障

#define SERVO_TMP_SENSOR_OFFLINE_WARNINGR_J1 0x108616  //关节一温度传感器通信异常
#define SERVO_TMP_SENSOR_OFFLINE_WARNINGR_J2 0x118616  //关节二温度传感器通信异常
#define SERVO_TMP_SENSOR_OFFLINE_WARNINGR_J3 0x128616  //关节三温度传感器通信异常
#define SERVO_TMP_SENSOR_OFFLINE_WARNINGR_J4 0x138616  //关节四温度传感器通信异常
#define SERVO_TMP_SENSOR_OFFLINE_WARNINGR_J5 0x148616  //关节五温度传感器通信异常
#define SERVO_TMP_SENSOR_OFFLINE_WARNINGR_J6 0x158616  //关节六温度传感器通信异常

#define DRIVE_ERR_POS_LAG_ERR_J1 0x108611  // joint 1 position error too large
#define DRIVE_ERR_POS_LAG_ERR_J2 0x118611  // joint 2 position error too large
#define DRIVE_ERR_POS_LAG_ERR_J3 0x128611  // joint 3 position error too large
#define DRIVE_ERR_POS_LAG_ERR_J4 0x138611  // joint 4 position error too large
#define DRIVE_ERR_POS_LAG_ERR_J5 0x148611  // joint 5 position error too large
#define DRIVE_ERR_POS_LAG_ERR_J6 0x158611  // joint 6 position error too large

#define DRIVE_ERR_POS_INC_OVER_LMT_J1 0x108612  // joint 1 position increment over limit
#define DRIVE_ERR_POS_INC_OVER_LMT_J2 0x118612  // joint 2 position increment over limit
#define DRIVE_ERR_POS_INC_OVER_LMT_J3 0x128612  // joint 3 position increment over limit
#define DRIVE_ERR_POS_INC_OVER_LMT_J4 0x138612  // joint 4 position increment over limit
#define DRIVE_ERR_POS_INC_OVER_LMT_J5 0x148612  // joint 5 position increment over limit
#define DRIVE_ERR_POS_INC_OVER_LMT_J6 0x158612  // joint 6 position increment over limit

#define DRIVE_ERR_POS_ACC_OVER_LMT_J1 0x108613  // joint 1 acceleration over limit
#define DRIVE_ERR_POS_ACC_OVER_LMT_J2 0x118613  // joint 2 acceleration over limit
#define DRIVE_ERR_POS_ACC_OVER_LMT_J3 0x128613  // joint 3 acceleration over limit
#define DRIVE_ERR_POS_ACC_OVER_LMT_J4 0x138613  // joint 4 acceleration over limit
#define DRIVE_ERR_POS_ACC_OVER_LMT_J5 0x148613  // joint 5 acceleration over limit
#define DRIVE_ERR_POS_ACC_OVER_LMT_J6 0x158613  // joint 6 acceleration over limit

#define DRIVE_ERR_POS_CMD_OVER_LMT_J1 0x108614  // joint 1 command position  over limit
#define DRIVE_ERR_POS_CMD_OVER_LMT_J2 0x118614  // joint 2 command position  over limit
#define DRIVE_ERR_POS_CMD_OVER_LMT_J3 0x128614  // joint 3 command position  over limit
#define DRIVE_ERR_POS_CMD_OVER_LMT_J4 0x138614  // joint 4 command position  over limit
#define DRIVE_ERR_POS_CMD_OVER_LMT_J5 0x148614  // joint 5 command position  over limit
#define DRIVE_ERR_POS_CMD_OVER_LMT_J6 0x158614  // joint 6 command position  over limit

#define DRIVE_ERR_CAN_OFF_LINE_J1 0x108615  // joint 1 CAN off line
#define DRIVE_ERR_CAN_OFF_LINE_J2 0x118615  // joint 2 CAN off line
#define DRIVE_ERR_CAN_OFF_LINE_J3 0x128615  // joint 3 CAN off line
#define DRIVE_ERR_CAN_OFF_LINE_J4 0x138615  // joint 4 CAN off line
#define DRIVE_ERR_CAN_OFF_LINE_J5 0x148615  // joint 5 CAN off line
#define DRIVE_ERR_CAN_OFF_LINE_J6 0x158615  // joint 6 CAN off line

#define DRIVE_ERR_UNDER_VOLTAGE_J1 0x103220  // joint 1 servo under voltage
#define DRIVE_ERR_UNDER_VOLTAGE_J2 0x113220  // joint 2 servo under voltage
#define DRIVE_ERR_UNDER_VOLTAGE_J3 0x123220  // joint 3 servo under voltage
#define DRIVE_ERR_UNDER_VOLTAGE_J4 0x133220  // joint 4 servo under voltage
#define DRIVE_ERR_UNDER_VOLTAGE_J5 0x143220  // joint 5 servo under voltage
#define DRIVE_ERR_UNDER_VOLTAGE_J6 0x153220  // joint 6 servo under voltage

#define DRIVE_ERR_OVER_VOLTAGE_J1 0x103210  // joint 1 servo over voltage
#define DRIVE_ERR_OVER_VOLTAGE_J2 0x113210  // joint 2 servo over voltage
#define DRIVE_ERR_OVER_VOLTAGE_J3 0x123210  // joint 3 servo over voltage
#define DRIVE_ERR_OVER_VOLTAGE_J4 0x133210  // joint 4 servo over voltage
#define DRIVE_ERR_OVER_VOLTAGE_J5 0x143210  // joint 5 servo over voltage
#define DRIVE_ERR_OVER_VOLTAGE_J6 0x153210  // joint 6 servo over voltage

#define DRIVE_ERR_FUSE_OPEN_J1 0x103211  // joint 1 fuse open
#define DRIVE_ERR_FUSE_OPEN_J2 0x113211  // joint 2 fuse open
#define DRIVE_ERR_FUSE_OPEN_J3 0x123211  // joint 3 fuse open
#define DRIVE_ERR_FUSE_OPEN_J4 0x133211  // joint 4 fuse open
#define DRIVE_ERR_FUSE_OPEN_J5 0x143211  // joint 5 fuse open
#define DRIVE_ERR_FUSE_OPEN_J6 0x153211  // joint 6 fuse open

#define DRIVE_ERR_DRIVER_OVERTEMP_J1 0x104310  // joint 1 servo over temperature
#define DRIVE_ERR_DRIVER_OVERTEMP_J2 0x114310  // joint 2 servo over temperature
#define DRIVE_ERR_DRIVER_OVERTEMP_J3 0x124310  // joint 3 servo over temperature
#define DRIVE_ERR_DRIVER_OVERTEMP_J4 0x134310  // joint 4 servo over temperature
#define DRIVE_ERR_DRIVER_OVERTEMP_J5 0x144310  // joint 5 servo over temperature
#define DRIVE_ERR_DRIVER_OVERTEMP_J6 0x154310  // joint 6 servo over temperature

#define DRIVE_ERR_IGBT_I2T_J1 0x102350  // joint 1 模块过载（I2T）
#define DRIVE_ERR_IGBT_I2T_J2 0x112350  // joint 2 模块过载（I2T）
#define DRIVE_ERR_IGBT_I2T_J3 0x122350  // joint 3 模块过载（I2T）
#define DRIVE_ERR_IGBT_I2T_J4 0x132350  // joint 4 模块过载（I2T）
#define DRIVE_ERR_IGBT_I2T_J5 0x142350  // joint 5 模块过载（I2T）
#define DRIVE_ERR_IGBT_I2T_J6 0x152350  // joint 6 模块过载（I2T）

#define DRIVE_ERR_OVER_POWER_J1 0x105480  // joint 1 伺服过功率
#define DRIVE_ERR_OVER_POWER_J2 0x115480  // joint 2 伺服过功率
#define DRIVE_ERR_OVER_POWER_J3 0x125480  // joint 3 伺服过功率
#define DRIVE_ERR_OVER_POWER_J4 0x135480  // joint 4 伺服过功率
#define DRIVE_ERR_OVER_POWER_J5 0x145480  // joint 5 伺服过功率
#define DRIVE_ERR_OVER_POWER_J6 0x155480  // joint 6 伺服过功率

#define DRIVE_ERR_ENC_AUTO_TURN_ERR_J1 0x103380  // joint 1 encoder auto-turn eror
#define DRIVE_ERR_ENC_AUTO_TURN_ERR_J2 0x113380  // joint 2 encoder auto-turn eror
#define DRIVE_ERR_ENC_AUTO_TURN_ERR_J3 0x123380  // joint 3 encoder auto-turn eror
#define DRIVE_ERR_ENC_AUTO_TURN_ERR_J4 0x133380  // joint 4 encoder auto-turn eror
#define DRIVE_ERR_ENC_AUTO_TURN_ERR_J5 0x143380  // joint 5 encoder auto-turn eror
#define DRIVE_ERR_ENC_AUTO_TURN_ERR_J6 0x153380  // joint 6 encoder auto-turn eror

#define DRIVE_ERR_OUT_LACK_PHASE_J1 0x103381  // joint 1 out lack of phase
#define DRIVE_ERR_OUT_LACK_PHASE_J2 0x113381  // joint 2 out lack of phase
#define DRIVE_ERR_OUT_LACK_PHASE_J3 0x123381  // joint 3 out lack of phase
#define DRIVE_ERR_OUT_LACK_PHASE_J4 0x133381  // joint 4 out lack of phase
#define DRIVE_ERR_OUT_LACK_PHASE_J5 0x143381  // joint 5 out lack of phase
#define DRIVE_ERR_OUT_LACK_PHASE_J6 0x153381  // joint 6 out lack of phase

#define DRIVE_ERR_IN_LACK_PHASE_J1 0x103130  // joint 1 输入缺相
#define DRIVE_ERR_IN_LACK_PHASE_J2 0x113130  // joint 2 输入缺相
#define DRIVE_ERR_IN_LACK_PHASE_J3 0x123130  // joint 3 输入缺相
#define DRIVE_ERR_IN_LACK_PHASE_J4 0x133130  // joint 4 输入缺相
#define DRIVE_ERR_IN_LACK_PHASE_J5 0x143130  // joint 5 输入缺相
#define DRIVE_ERR_IN_LACK_PHASE_J6 0x153130  // joint 6 输入缺相

#define DRIVE_ERR_INER_CONNECT_ERR_J1 0x105441  // joint 1 内部连接错误
#define DRIVE_ERR_INER_CONNECT_ERR_J2 0x115441  // joint 2 内部连接错误
#define DRIVE_ERR_INER_CONNECT_ERR_J3 0x125441  // joint 3 内部连接错误
#define DRIVE_ERR_INER_CONNECT_ERR_J4 0x135441  // joint 4 内部连接错误
#define DRIVE_ERR_INER_CONNECT_ERR_J5 0x145441  // joint 5 内部连接错误
#define DRIVE_ERR_INER_CONNECT_ERR_J6 0x155441  // joint 6 内部连接错误

#define DRIVE_ERR_PARA_ERROR_J1 0x105280  // joint 1 内部参数错误
#define DRIVE_ERR_PARA_ERROR_J2 0x115280  // joint 2 内部参数错误
#define DRIVE_ERR_PARA_ERROR_J3 0x125280  // joint 3 内部参数错误
#define DRIVE_ERR_PARA_ERROR_J4 0x135280  // joint 4 内部参数错误
#define DRIVE_ERR_PARA_ERROR_J5 0x145280  // joint 5 内部参数错误
#define DRIVE_ERR_PARA_ERROR_J6 0x155280  // joint 6 内部参数错误

#define DRIVE_ERR_PID_OVERFLOW_J1 0x105281  // joint 1 PID运算溢出
#define DRIVE_ERR_PID_OVERFLOW_J2 0x115281  // joint 2 PID运算溢出
#define DRIVE_ERR_PID_OVERFLOW_J3 0x125281  // joint 3 PID运算溢出
#define DRIVE_ERR_PID_OVERFLOW_J4 0x135281  // joint 4 PID运算溢出
#define DRIVE_ERR_PID_OVERFLOW_J5 0x145281  // joint 5 PID运算溢出
#define DRIVE_ERR_PID_OVERFLOW_J6 0x155281  // joint 6 PID运算溢出

#define DRIVE_ERR_RobotSerie_ERR_J1 0x105211  // joint 1 Zu系列选择错误
#define DRIVE_ERR_RobotSerie_ERR_J2 0x115211  // joint 2 Zu系列选择错误
#define DRIVE_ERR_RobotSerie_ERR_J3 0x125211  // joint 3 Zu系列选择错误
#define DRIVE_ERR_RobotSerie_ERR_J4 0x135211  // joint 4 Zu系列选择错误
#define DRIVE_ERR_RobotSerie_ERR_J5 0x145211  // joint 5 Zu系列选择错误
#define DRIVE_ERR_RobotSerie_ERR_J6 0x155211  // joint 6 Zu系列选择错误

#define DRIVE_ERR_MOTOR_OVERTEMP_J1 0x104210  // joint 1 电机过温
#define DRIVE_ERR_MOTOR_OVERTEMP_J2 0x114210  // joint 2 电机过温
#define DRIVE_ERR_MOTOR_OVERTEMP_J3 0x124210  // joint 3 电机过温
#define DRIVE_ERR_MOTOR_OVERTEMP_J4 0x134210  // joint 4 电机过温
#define DRIVE_ERR_MOTOR_OVERTEMP_J5 0x144210  // joint 5 电机过温
#define DRIVE_ERR_MOTOR_OVERTEMP_J6 0x154210  // joint 6 电机过温

#define DRIVE_ERR_DBRAKE_OVER_LOAD_J1 0x107182  // joint 1 高频注入反向
#define DRIVE_ERR_DBRAKE_OVER_LOAD_J2 0x117182  // joint 2 高频注入反向
#define DRIVE_ERR_DBRAKE_OVER_LOAD_J3 0x127182  // joint 3 高频注入反向
#define DRIVE_ERR_DBRAKE_OVER_LOAD_J4 0x137182  // joint 4 高频注入反向
#define DRIVE_ERR_DBRAKE_OVER_LOAD_J5 0x147182  // joint 5 高频注入反向
#define DRIVE_ERR_DBRAKE_OVER_LOAD_J6 0x157182  // joint 6 高频注入反向

#define SERVO_CALZERO_DH_WARNINGR_J1 0x105202  //关节一校零与DH参数冲突
#define SERVO_CALZERO_DH_WARNINGR_J2 0x115202  //关节二校零与DH参数冲突
#define SERVO_CALZERO_DH_WARNINGR_J3 0x125202  //关节三校零与DH参数冲突
#define SERVO_CALZERO_DH_WARNINGR_J4 0x135202  //关节四校零与DH参数冲突
#define SERVO_CALZERO_DH_WARNINGR_J5 0x145202  //关节五校零与DH参数冲突
#define SERVO_CALZERO_DH_WARNINGR_J6 0x155202  //关节六校零与DH参数冲突

#define DRIVE_ERR_POWER_ID_ERR_J1 0x105210  // joint 1 power id error
#define DRIVE_ERR_POWER_ID_ERR_J2 0x115210  // joint 2 power id error
#define DRIVE_ERR_POWER_ID_ERR_J3 0x125210  // joint 3 power id error
#define DRIVE_ERR_POWER_ID_ERR_J4 0x135210  // joint 4 power id error
#define DRIVE_ERR_POWER_ID_ERR_J5 0x145210  // joint 5 power id error
#define DRIVE_ERR_POWER_ID_ERR_J6 0x155210  // joint 6 power id error

#define DRIVE_ERR_EEPROM_ERR_J1 0x105282  // joint 1 eeprom error
#define DRIVE_ERR_EEPROM_ERR_J2 0x115282  // joint 2 eeprom error
#define DRIVE_ERR_EEPROM_ERR_J3 0x125282  // joint 3 eeprom error
#define DRIVE_ERR_EEPROM_ERR_J4 0x135282  // joint 4 eeprom error
#define DRIVE_ERR_EEPROM_ERR_J5 0x145282  // joint 5 eeprom error
#define DRIVE_ERR_EEPROM_ERR_J6 0x155282  // joint 6 eeprom error

#define DRIVE_ERR_POWERON_FAILED_J1 0x105283  // joint 1 failed to power on
#define DRIVE_ERR_POWERON_FAILED_J2 0x115283  // joint 2 failed to power on
#define DRIVE_ERR_POWERON_FAILED_J3 0x125283  // joint 3 failed to power on
#define DRIVE_ERR_POWERON_FAILED_J4 0x135283  // joint 4 failed to power on
#define DRIVE_ERR_POWERON_FAILED_J5 0x145283  // joint 5 failed to power on
#define DRIVE_ERR_POWERON_FAILED_J6 0x155283  // joint 6 failed to power on

#define DRIVE_ERR_ENC_OVERTEMP_J1 0x106010  // joint 1 encoder over temperature
#define DRIVE_ERR_ENC_OVERTEMP_J2 0x116010  // joint 2 encoder over temperature
#define DRIVE_ERR_ENC_OVERTEMP_J3 0x126010  // joint 3 encoder over temperature
#define DRIVE_ERR_ENC_OVERTEMP_J4 0x136010  // joint 4 encoder over temperature
#define DRIVE_ERR_ENC_OVERTEMP_J5 0x146010  // joint 5 encoder over temperature
#define DRIVE_ERR_ENC_OVERTEMP_J6 0x156010  // joint 6 encoder over temperature

#define DRIVE_ERR_MOTOR_I2T_J1 0x107180  // joint 1 motor I2T
#define DRIVE_ERR_MOTOR_I2T_J2 0x117180  // joint 2 motor I2T
#define DRIVE_ERR_MOTOR_I2T_J3 0x127180  // joint 3 motor I2T
#define DRIVE_ERR_MOTOR_I2T_J4 0x137180  // joint 4 motor I2T
#define DRIVE_ERR_MOTOR_I2T_J5 0x147180  // joint 5 motor I2T
#define DRIVE_ERR_MOTOR_I2T_J6 0x157180  // joint 6 motor I2T

#define DRIVE_ERR_BRAKE_ERR_J1 0x107181  // joint 1 brake error
#define DRIVE_ERR_BRAKE_ERR_J2 0x117181  // joint 2 brake error
#define DRIVE_ERR_BRAKE_ERR_J3 0x127181  // joint 3 brake error
#define DRIVE_ERR_BRAKE_ERR_J4 0x137181  // joint 4 brake error
#define DRIVE_ERR_BRAKE_ERR_J5 0x147181  // joint 5 brake error
#define DRIVE_ERR_BRAKE_ERR_J6 0x157181  // joint 6 brake error

#define DRIVE_ERR_ENC_INTERNAL_ERR_J1 0x107386  // joint 1 encoder internal error
#define DRIVE_ERR_ENC_INTERNAL_ERR_J2 0x117386  // joint 2 encoder internal error
#define DRIVE_ERR_ENC_INTERNAL_ERR_J3 0x127386  // joint 3 encoder internal error
#define DRIVE_ERR_ENC_INTERNAL_ERR_J4 0x137386  // joint 4 encoder internal error
#define DRIVE_ERR_ENC_INTERNAL_ERR_J5 0x147386  // joint 5 encoder internal error
#define DRIVE_ERR_ENC_INTERNAL_ERR_J6 0x157386  // joint 6 encoder internal error

#define DRIVE_ERR_UNMATCHED_VERSION_J1 0x107580  // joint 1 unmatched servo version
#define DRIVE_ERR_UNMATCHED_VERSION_J2 0x117580  // joint 2 unmatched servo version
#define DRIVE_ERR_UNMATCHED_VERSION_J3 0x127580  // joint 3 unmatched servo version
#define DRIVE_ERR_UNMATCHED_VERSION_J4 0x137580  // joint 4 unmatched servo version
#define DRIVE_ERR_UNMATCHED_VERSION_J5 0x147580  // joint 5 unmatched servo version
#define DRIVE_ERR_UNMATCHED_VERSION_J6 0x157580  // joint 6 unmatched servo version

#define DRIVE_ERR_FUSE_DISCONNECTED_J1 0x103211  // 关节一保险丝断路
#define DRIVE_ERR_FUSE_DISCONNECTED_J2 0x113211  // 关节二保险丝断路
#define DRIVE_ERR_FUSE_DISCONNECTED_J3 0x123211  // 关节三保险丝断路
#define DRIVE_ERR_FUSE_DISCONNECTED_J4 0x133211  // 关节四保险丝断路
#define DRIVE_ERR_FUSE_DISCONNECTED_J5 0x143211  // 关节五保险丝断路
#define DRIVE_ERR_FUSE_DISCONNECTED_J6 0x153211  // 关节六保险丝断路

#define DRIVE_ERR_ENC_MAG_SIGNAL_ERR_J1 0x107388  // 关节一编码器磁信号异常
#define DRIVE_ERR_ENC_MAG_SIGNAL_ERR_J2 0x117388  // 关节二编码器磁信号异常
#define DRIVE_ERR_ENC_MAG_SIGNAL_ERR_J3 0x127388  // 关节三编码器磁信号异常
#define DRIVE_ERR_ENC_MAG_SIGNAL_ERR_J4 0x137388  // 关节四编码器磁信号异常
#define DRIVE_ERR_ENC_MAG_SIGNAL_ERR_J5 0x147388  // 关节五编码器磁信号异常
#define DRIVE_ERR_ENC_MAG_SIGNAL_ERR_J6 0x157388  // 关节六编码器磁信号异常

#define DRIVE_ERR_POS_DEVIATION_ERR_J1 0x108000  //关节一位置偏离-保护性停止(碰撞)
#define DRIVE_ERR_POS_DEVIATION_ERR_J2 0x118000  //关节二位置偏离-保护性停止(碰撞)
#define DRIVE_ERR_POS_DEVIATION_ERR_J3 0x128000  //关节三位置偏离-保护性停止(碰撞)
#define DRIVE_ERR_POS_DEVIATION_ERR_J4 0x138000  //关节四位置偏离-保护性停止(碰撞)
#define DRIVE_ERR_POS_DEVIATION_ERR_J5 0x148000  //关节五位置偏离-保护性停止(碰撞)
#define DRIVE_ERR_POS_DEVIATION_ERR_J6 0x158000  //关节六位置偏离-保护性停止(碰撞)

#define DRIVE_ERR_POS_DEVIATION_WARNING_J1 0x108001  //关节一位置偏离报警
#define DRIVE_ERR_POS_DEVIATION_WARNING_J2 0x118001  //关节二位置偏离报警
#define DRIVE_ERR_POS_DEVIATION_WARNING_J3 0x128001  //关节三位置偏离报警
#define DRIVE_ERR_POS_DEVIATION_WARNING_J4 0x138001  //关节四位置偏离报警
#define DRIVE_ERR_POS_DEVIATION_WARNING_J5 0x148001  //关节五位置偏离报警
#define DRIVE_ERR_POS_DEVIATION_WARNING_J6 0x158001  //关节六位置偏离报警

#define DRIVE_WARN_ENCODE_CNT 0x8384  //编码器计数预警
#define DRIVE_WARN_ENCODE_CNT_J(INDEX) (0x100000 + 0x10000 * (INDEX) + DRIVE_WARN_ENCODE_CNT)

#define DRIVE_WARN_ENCODE_DUAL_CHECK 0x8385  //双编码器校验预警
#define DRIVE_WARN_ENCODE_DUAL_CHECK_J(INDEX) (0x100000 + 0x10000 * (INDEX) + DRIVE_WARN_ENCODE_DUAL_CHECK)

#define DRIVE_WARN_ENCODE_Z 0x8387  //编码器Z线捕捉预警
#define DRIVE_WARN_ENCODE_Z_J(INDEX) (0x100000 + 0x10000 * (INDEX) + DRIVE_WARN_ENCODE_Z)

#define DRIVE_WARN_ENCODE_SIGNAL 0x8388  //编码器信号异常预警
#define DRIVE_WARN_ENCODE_SIGNAL_J(INDEX) (0x100000 + 0x10000 * (INDEX) + DRIVE_WARN_ENCODE_SIGNAL)

#define DRIVE_WARN_ENCODE_INNER 0x7001  //编码器内部故障预警
#define DRIVE_WARN_ENCODE_INNER_J(INDEX) (0x100000 + 0x10000 * (INDEX) + DRIVE_WARN_ENCODE_INNER)

#define DRIVE_ERR_UNKNOWN 0x10FFFF  //伺服发生控制器未记录在案的错误

/******************************errors from servo side (end)*********************************/

/******************************error code from extio****************************************/
#define EXTIO_ERR_INIT_RTU_CONNECTION 0x201102      // filed to create rtu connection during initialization
#define EXTIO_ERR_INIT_TCP_CONNECTION 0x201202      // filed to create tcp connection during initialization
#define EXTIO_ERR_INIT_UNKNOWN 0x201304             // unknown error during initalization
#define EXTIO_ERR_INIT_RTU_INCONSISTENT 0x201101    // rtu inconsistent during initialization
#define EXTIO_ERR_INIT_TCP_FORMAT 0x201201          // tcp format error during initialization
#define EXTIO_ERR_RUNTIME_RTU_OFFLINE 0x202103      // rtu node offline during runtime
#define EXTIO_ERR_RUNTIME_TCP_OFFLINE 0x202102      // tcp node offline during runtime
#define EXTIO_WARNING_INIT_RTU_PARAMETERS 0x201104  // the serial bus parameters are inconsistent
/******************************error code from extio****************************************/

/******************************error code from sensor module & SCB****************************/
#define TORQSENSOR_ERR_FAILED_INIT_CONN 0x3F0001  // failed to initialize the connection with torque sensor
#define TORQSENSOR_ERR_CANNOT_RECV_DATA 0x3F1001  // cannot receive data from torque sensor
#define TORQSENSOR_ERR_RECV_WRONG_DATA 0x3F1002   // wrong data is received from torque sensor

// from SCB module
#define SCB_ERR_PDU_TEMPERATURE_ABNORMAL 0x304281  // PDU temperature abnormal | warning, no handling
#define SCB_ERR_TCASE_ABNORMAL 0x304282            // Braking resister is over temperature | power off the robot
#define SCB_ERR_5V_VOLTAGE_ABNORMAL 0x303281       // 5V spower upply abnormal | no prompt, no handling
#define SCB_ERR_12V_VOLTAGE_ABNORMAL 0x303282      // 12V power supply abnormal | no prompt, no handling
#define SCB_ERR_24V_VOLTAGE_ABNORMAL 0x303283      // 24V power supply abnormal | warning and pause the program
#define SCB_ERR_220V_VOLTAGE_ABNORMAL 0x303181     // 220V power supply abnormal | warning, no handling
#define SCB_ERR_220V_PWR_RALAY_ABNORMAL 0x303182   // main supply relay is abnormal | warning, no handling
#define SCB_ERR_SAFETY_SIGNAL_ABNORMAL_REFUSE_POWERON \
    0x303184  // The safety digital signal anomaly has not been repaired SCB refuses to power on the robot 安全信号异常未被修复SCB拒绝本体上电
#define SCB_ERR_OUT_BODY_SUPPLY_ABNORMAL 0x303381  // supply voltage of output body abnormal | warning, scb do no allow to turn on the power
#define SCB_ERR_RELAY_ABNORMAL 0x303387            // PSCB relay abnormal

#define SCB_ERR_USR_IO_SUPPLY_ABNORMAL 0x302384  // supply current of user IO abnormal | warning, 提示维护（请检查数字回路）
#define SCB_ERR_IPC_CURRENT_ABNORMAL 0x302385    // ipc current abnormal | 弹窗，提示维护（请检查工控机）
#define SCB_ERR_FAN_CURRENT_ABNORMAL 0x302380    // fan current abnormal | 弹窗，提示维护（请检查风机）

#define SCB_ERR_BODY_SUPPLY_ABNORMAL_L1 0x302381  // output body supply current abnormal level 1 warning:25A | 弹窗，机器人供电电流过大
#define SCB_ERR_BODY_SUPPLY_ABNORMAL_L2 0x302382  // output body supply current abnormal level 2 warning:31.25A
#define SCB_ERR_BODY_SUPPLY_ABNORMAL_L3 0x302383  // output body supply current abnormal level 3 warning:37.25A
#define SCB_ERR_ROBOT_POWER_EXCEPTION 0x302391    // 本体功率异常
#define SCB_ERR_DRAG_OVER_SPEED 0x309081          // tool center drag over speed | prompt
#define SCB_ERR_EMEGENCY_STOP 0x309082            // Emergency Stop | prompt
#define SCB_ERR_ROBOT_POWER_LIMIT 0x309083        // Robot power exceed the limit机器人整机功率报警阈值
#define SCB_ERR_BP_CAN_COMM_ABNORMAL 0x308181     // button panel communication abnormal  | 仅记录，不弹窗，不停机
#define SCB_ERR_CTRL_CAN_COMM_ABNORMAL 0x308182   // controller communication abnormal | 仅记录，不弹窗，不停机
#define SCB_ERR_BODY_CAN_COMM_ABNORMAL 0x308183   // ontology CAN communication is interrupted | 仅记录，不弹窗，不停机
#define SCB_ERR_TIO_CAN_COMM_ABBORMAL 0x308184    // TIO CAN communication is interrupted | 仅记录，不弹窗，不停机
#define SCB_ERR_CAN_NORMAL_WAIT_TIMEOUT 0x308185  // wait CAN communication normal timeout | 仅记录，不弹窗，不停机
#define SCB_ERR_BP_ESTOP_INCONSISTENT 0x305081    // handle emergency stop signal inconsistent | 弹窗，提示维护（请检查急停保护信号接线）
#define SCB_ERR_USR_ESTOP_INCONSISTENT 0x305082  // user emergency stop signal input inconsistent | 弹窗，提示维护（请检查急停保护信号接线）
#define SCB_ERR_PROTECTIVE_STOP_INCONSISTENT 0x305083  // inconsistent protective stop signal input | 弹窗，提示维护（请检查保护性停止信号接线）
#define SCB_ERR_RELAY_ADHESION 0x305084                // relay adhesion
#define SCB_ERR_BRAKE_RESISTOR_OVER_TEMPE 0x305085                         // Overtemperature of braking resistor
#define SCB_ERR_STICK_SERVO_ENA_ABNORMAL 0x305086                          // Servo enable input on stick is abnormal
#define SCB_ERR_ADDI_ESTOP_ABNORMAL 0x305087                               // 附加急停信号异常Additionalemergencystoploopfault
#define SCB_ERR_ADDI_PSTOP_ABNORMAL 0x305088                               // 附加保护性停止信号异常Additionalprotectivestoploopfault
#define SCB_ERR_ADDI_PSTOP_RESET_ABNORMAL 0x305089                         // 保护性停止复位信号异常Protectivestopresetloopfault
#define SCB_ERR_REDUCE_INPUT_ABNORMAL 0x30508A                             // 衰减模式输入信号异常Reducemodeinputsignalfault
#define SCB_ERR_THREE_POSITION_ENABLING_INPUT_ABNORMAL 0x30508B            //三位置使能信号输入异常 Three position enabling  input signal fault
#define SCB_ERR_CLOSED_COLLISION_DETECTION_SIGNAL_INPUT_ABNORMAL 0x305090  //关闭碰撞检测信号输入异常
#define SCB_ERR_COLLISION_DETECTION_LV1_SIGNAL_INPUT_ABNORMAL 0x305091     //碰撞灵敏度LV1信号输入异常
#define SCB_ERR_COLLISION_DETECTION_LV2_SIGNAL_INPUT_ABNORMAL 0x305092     //碰撞灵敏度LV2信号输入异常
#define SCB_ERR_COLLISION_DETECTION_LV3_SIGNAL_INPUT_ABNORMAL 0x305093     //碰撞灵敏度LV3信号输入异常
#define SCB_ERR_COLLISION_DETECTION_LV4_SIGNAL_INPUT_ABNORMAL 0x305094     //碰撞灵敏度LV4信号输入异常
#define SCB_ERR_COLLISION_DETECTION_LV5_SIGNAL_INPUT_ABNORMAL 0x305095     //碰撞灵敏度LV5信号输入异常
#define SCB_ERR_COLLISION_DETECTION_LV7_SIGNAL_INPUT_ABNORMAL 0x305097     //碰撞灵敏度极低信号输入异常

/******************************error code from sensor module****************************/

#define MISCELLANEOUS_ERROR 0x0FFFFE /*miscellaneous error*/
#define UNKNOWN_ERROR 0x0FFFFF       /*unknown error*/

/******************************error code from sensor module****************************/

/******************************information code definition******************************/
#define INFO_EMERGENCY_STOPPED 0x10F0000             //	system emergency stopped	系统急停触发
#define INFO_EMERGENCY_STOP_RESET 0x10F0001          //	system emergency stop reset	系统急停复位
#define INFO_ROBOT_POWERED_ON 0x10F0002              //	robot powered on	机器人电源已打开
#define INFO_ROBOT_POWERED_OFF 0x10F0003             //	robot powered off	机器人电源已关闭
#define INFO_ROBOT_ENABLED 0x10F0004                 //	robot servo enabled	机器人伺服使能完成
#define INFO_ROBOT_DISABLED 0x10F0005                //	robot servo disabled	机器人伺服使能关闭
#define INFO_ROBOT_PERCENTAGE_MODE_RESET 0x10F0006   //	robot exit from percentage mode	    机器人退出倍率模式
#define INFO_ROBOT_PERCENTAGE_MODE_LEVEL1 0x10F0007  //	robot in percentage mode (leve 1)	机器人进入一级倍率模式
#define INFO_ROBOT_PERCENTAGE_MODE_LEVEL2 0x10F0008  //	robot in percentage mode (leve 2)	机器人进入二级倍率模式
#define INFO_ROBOT_PROTECTIVE_STOP 0x10F0009         //	robot in protective stop	机器人进入保护性停止
#define INFO_ROBOT_COLLISION_STOP_RESET 0x10F000a    //	robot exit from collision protective stop	机器人退出碰撞保护性停止
#define INFO_ROBOT_COLLISION_STOPPED 0x10F000b       //	robot in collision protective stop	机器人进入碰撞保护性停止
#define INFO_JOINT_LIMIT_RECOVER 0x10F000c           //	robot recover from joint limit state	机器人关节限位状态恢复
#define INFO_CONVEYOR_TRACK_ENABLED 0x10F000d        //	conveyor track function enabled	传送带功能已开启
#define INFO_CONVEYOR_TRACK_DISABLED 0x10F000e       //	conveyor track function disabled	传送带功能已关闭
#define INFO_COMPLIANCE_CTRL_ENABLED 0x10F000f       //	compliance control function enabled	柔顺控制功能已开启
#define INFO_COMPLIANCE_CTRL_DISABLED 0x10F0010      //	compliance control function disabled	柔顺控制功能已关闭
#define INFO_DRAG_ENTER 0x10F0011                    //	robot enter drag mode	机器人进入拖拽模式
#define INFO_DRAG_EXIT 0x10F0012                     //	robot exit from drag mode	机器人退出拖拽模式
#define INFO_FORCE_DRAG_ENABLED 0x10F0013            //	robot enter drag mode with force control	机器人进入力控牵引模式
#define INFO_FORCE_DRAG_DISABLED 0x10F0014           //	robot exit from drag mode with force control	机器人退出力控牵引模式
#define INFO_SERVOMOVE_ENABLED 0x10F0015             //	robot servo move enabled 	机器人SERVO运动模式已开启
#define INFO_SERVOMOVE_DISABLED 0x10F0016            //	robot servo move disabled	机器人SERVO运动模式已关闭
#define INFO_SAFEZONE_VIOLATE 0x10F0017              //	robot violate safe zone 	机器人超出安全边界外
#define INFO_SAFEZONE_VIOLATE_RESET 0x10F0018        //	robot back to safe zone	机器人返回安全边界内
#define INFO_FORCE_JOINT_LIMIT_VEL_START 0x10F0019   //	start to limit cartesian velocity to comply with joint velocity limit	开始笛卡尔空间限速
#define INFO_FORCE_JOINT_LIMIT_VEL_END 0x10F001a     //	stop limiting cartesian velocity to comply with joint velocity limit	停止笛卡尔空间限速
#define INFO_PROGRAM_STARTED 0x10F001b               //	user program started	作业程序开始执行
#define INFO_PROGRAM_PAUSED 0x10F001c                //	user program paused	作业程序暂停执行
#define INFO_PROGRAM_RESUMED 0x10F001d               //	user program resumed	作业程序恢复执行
#define INFO_PROGRAM_STOPPED 0x10F001e               //	user program stopped	作业程序停止执行

#define INFO_ROBOT_REDUCE_MODE 0x10F0020            // robot in reduced mode   机器人进入缩减模式
#define INFO_ROBOT_REDUCE_MODE_RESET 0x10F0021      // robot exit from reduce mode  机器人退出缩减模式
#define INFO_ROBOT_MOMENTUM_LIMIT 0x10F0022         // robot momentum limited   机器人动量缩减
#define INFO_ROBOT_POWER_LIMIT 0x10F0023            // robot power limited  机器人能量缩减
#define INFO_ROBOT_PROTECTIVE_STOP_RESET 0x10F0024  //	robot exit protective stop	机器人退出保护性停止

#define INFO_SAFETY_CONF_CHECKSUM_CHANGED 0x10F0025           //user safety config changed 	用户安全配置变更
#define INFO_SAFETY_CONF_INIT_POSE_CHANGED 0x10F0026          //user safety config init pose changed 	用户安全配置初始姿态变更
#define INFO_SAFETY_CONF_INIT_POSE_TOL_CHANGED 0x10F0027      //user safety config init pose tol changed 	用户安全配置初始姿态误差变更
#define INFO_SAFETY_CONF_RUN_MODE_CHANGED 0x10F0028           //user safety config run mode changed 	用户安全配置控制器运行模式变更
#define INFO_SAFETY_CONF_JOINT_MIN_LIMITS_CHANGED 0x10F0029   //user safety config joint min limit changed 	用户安全配置关节负限位变更
#define INFO_SAFETY_CONF_JOINT_MAX_LIMITS_CHANGED 0x10F002A   //user safety config joint max limit changed 	用户安全配置关节正限位变更
#define INFO_SAFETY_CONF_SAFETY_FUNCDI_MAP_CHANGED 0x10F002B  //user safety config safety funcdi map changed 	用户安全功能di配置变更
#define INFO_SAFETY_CONF_SAFETY_FUNCDO_MAP_CHANGED 0x10F002C  //user safety config safety funcdo map changed 	用户安全功能do配置变更
#define INFO_SAFETY_CONF_ROBOT_POWER_LIMIT_CHANGED 0x10F002D  //user safety config robot power limit changed 	机器人功率限制配置变更
#define INFO_SAFETY_CONF_TCP_VEL_LIMIT_CHANGED 0x10F002E      //user safety config tcp vel limit changed 	机器人末端速度限制变更
#define INFO_SAFETY_CONF_STOPPING_DIST_CHANGED 0x10F002F      //user safety config stopping dist limit changed 	用户安全配置停止距离变更
#define INFO_SAFETY_CONF_STOPPING_TIME_CHANGED 0x10F0030      //user safety config stopping time limit changed 	用户安全配置停止时间变更
#define INFO_SAFETY_CONF_ELBOW_VEL_LIMIT_CHANGED 0x10F0031    //user safety config elbow vel limit changed 	肘部速度限制变更
#define INFO_SAFETY_CONF_MOMENTUM_LIMIT_CHANGED 0x10F0032     //user safety config momentum limit changed 	动量限制变更
#define INFO_SAFETY_CONF_JOINT_VEL_LIMIT_CHANGED 0x10F0033    //user safety config joint vel limit changed 	关节速度限制变更
#define INFO_SAFETY_CONF_JOINT_ERR_LIMIT_CHANGED 0x10F0034    //user safety config joint err alarm threshold changed 	关节误差报警阈值变更
#define INFO_SAFETY_CONF_ATTITUDE_SAFETY_CHANGED 0x10F0035    //user safety config joint tool safety attitude limit changed 	工具姿态约束变更
#define INFO_SAFETY_CONF_COLLISION_OPTION_CHANGED 0x10F0036   //user safety config clsn option changed 	碰撞选项变更
#define INFO_SAFETY_CONF_CLSN_SENSITIVITY_CHANGED 0x10F0037   //user safety config clsn_sensitivity changed 	碰撞灵敏度变更
#define INFO_SAFETY_CONF_AUTO_WORK_CHANGED 0x10F0038          //user safety config autowork enable changed 	开机默认加载配置变更
#define INFO_SAFETY_CONF_ONE_KEY_ENABLE_CHANGED 0x10F0039     //user safety config one key enable changed 	上电自动使能状态变更
#define INFO_SAFETY_CONF_AUTOPROGRAM_CHANGED 0x10F003A        //user safety config autowork filename changed 	使能自动运行程序状态变更
#define INFO_SAFE_ZONE_GLOBAL_CONF_CHANGED 0x10F003B          //user safety config global safe zone changed 	安全平面全局配置变更
#define INFO_INIT_SAFETY_CRC_CHANGED 0x10F003C                //user safety config changed during init	初始化过程检测到安全参数变化
#define INFO_SAFETY_CONF_FORCE_LIMIT_CHANGED 0x10F003D        //force limit changed 末端力限制變更
#define INFO_INIT_SAFETY_JOINT_SENSITIVITY_CHANGED 0x10F003F  //joint collision sensitivity changed 关节碰撞检测灵敏度变更
#define INFO_INIT_SAFETY_COLLISION_ENABLE_CHANGED 0x10F0040   //collision detection enable changed 碰撞检测使能变更
#define INFO_SAFE_ZONE_SINGLE_CONF_CHANGED 0x10F0041          //user safety config  single safe zone changed 	安全平面单个平面配置变更
#define INFO_SAFE_ZONE_SINGLE_PLANE_CHANGED 0x10F0042         //user safety config  single safe plane changed 	安全平面单个平面点位变更

#define INFO_SAFETY_CONF_ROBOT_POWER_LIMIT_REDUCE_CHANGED 0x10F0043  //user safety config robot power limit in reduce mode changed 	机器人缩减功率限制配置变更
#define INFO_SAFETY_CONF_MOMENTUM_LIMIT_REDUCE_CHANGED 0x10F0044  //user safety config momentum limit in reduce mode changed 	缩减动量限制变更
#define INFO_SAFETY_CONF_TCP_VEL_LIMIT_REDUCE_CHANGED 0x10F0045  //user safety config tcp vel limit in reduce mode changed 	机器人末端缩减速度限制变更
#define INFO_SAFETY_CONF_STOPPING_DIST_REDUCE_CHANGED 0x10F0046  //user safety config stopping dist limit changed 	用户安全配置缩减停止距离变更
#define INFO_SAFETY_CONF_STOPPING_TIME_REDUCE_CHANGED 0x10F0047  //user safety config stopping time limit changed 	用户安全配置缩减停止时间变更
#define INFO_EMERGENCY_STOP_OCCURS_CANNOT_POWER_ON \
    0x10F0048  //When an emergency stop occurs, the power-on operation cannot be performed.  急停发生时无法执行上电操作。
#define INFO_SAFETY_CONF_DRAG_TCP_VEL_LIMIT_CHANGED 0x10F0049  //user safety config drag tcp vel limit changed

#define INFO_IS_ABOUT_TO_EXCEED_SAFEZONE 0x10F0048  // robot is about to exceed the safety plane 	机器人即将超出安全平面

#define INFO_TORQUE_SENSOR_ENABLED 0x10F0100   //	torque sensor enabled	力矩传感器已开启
#define INFO_TORQUE_SENSOR_DISABLED 0x10F0101  //	torque sensor disabled	力矩传感器已关闭
#define INFO_EXTIO_ENABLED 0x10F0102           //	extended io modules enabled 	扩展IO模块已启用
#define INFO_EXTIO_DISABLED 0x10F0103          //	extended io modules disabled	扩展IO模块已关闭

#define INFO_FDI_PROGRUN_TRIGED 0x10F0200                 //	function DI(program run) triggered	功能DI（执行程序）已触发
#define INFO_FDI_PROGPAUSE_TRIGED 0x10F0201               //	function DI(program pause) triggered	功能DI（暂停程序）已触发
#define INFO_FDI_PROGRESUME_TRIGED 0x10F0202              //	function DI(program resume) triggered	功能DI（恢复程序）已触发
#define INFO_FDI_PROGSTOP_TRIGED 0x10F0203                //	function DI(program stop) triggered	功能DI（停止程序）已触发
#define INFO_FDI_POWERON_TRIGED 0x10F0204                 //	function DI(power on) triggered	功能DI（打开电源）已触发
#define INFO_FDI_POWEROFF_TRIGED 0x10F0205                //	function DI(power off) triggered	功能DI（关闭电源）已触发
#define INFO_FDI_SERVOON_TRIGED 0x10F0206                 //	function DI(servo enable) triggered	功能DI（伺服使能打开）已触发
#define INFO_FDI_SERVOOFF_TRIGED 0x10F0207                //	function DI(servo disable) triggered	功能DI（伺服使能关闭）已触发
#define INFO_FDI_PERCENTAGE_MODE_LEVEL1_TRIGED 0x10F0208  //	function DI(percentage level 1) triggered	功能DI（进入一级倍率模式）已触发
#define INFO_FDI_PERCENTAGE_MODE_LEVEL2_TRIGED 0x10F0209  //	function DI(percentage level 2) triggered	功能DI（进入二级倍率模式）已触发
#define INFO_FDI_PROTECTIVE_STOP_TRIGED 0x10F020a         //	function DI(protective stop) triggered	功能DI（进入保护性停止）已触发
#define INFO_FDI_BACKTOINITPOS_TRIGED 0x10F020b           //	function DI(to initial position) triggered	功能DI（返回初始位置）已触发
#define INFO_FDI_CLEARERROR_TRIGED 0x10F020c              //	function DI(clear error) triggered	功能DI（清除错误）已触发
#define INFO_FDI_DRAGMODEON_TRIGED 0x10F020d              //	function DI(enable drag mode) triggered	功能DI（进入拖拽模式）已触发
#define INFO_FDI_DRAGMODEOFF_TRIGED 0x10F020e             //	function DI(disable drag mode) triggered	功能DI（退出拖拽模式）已触发
#define ERR_FDI_PROGRUN_LOCKED \
    0x10F020f  //function DI(program pause or program stop) triggered,(program run) should not be executed.	功能DI（停止程序 或 暂停程序）已触发，（运行程序）不该被执行
#define ERR_FDI_RESUME_LOCKED \
    0x10F0210  //function DI(program pause) triggered,(program resume) should not be executed.	功能DI（暂停程序）已触发，（恢复程序）不该被执行
#define ERR_FDI_POWER_ON_LOCKED \
    0x10F0211  //	function DI(power off) triggered,(power on) should not be executed. 功能DI（关闭电源）已触发，（打开电源）不该被执行
#define ERR_FDI_SERVO_ON_LOCKED 0x10F0212  //	function DI(servo off) triggered,(servo on) should not be executed.	功能DI（下使能）已触发，（上使能）不该被执行

#define INFO_FDO_IDLE_SET 0x10F0220                      //	function DO(program idle) set	功能DO（作业空闲）置位
#define INFO_FDO_IDLE_RESET 0x10F0221                    //	function DO(program idle) reset	功能DO（作业空闲）复位
#define INFO_FDO_PAUSE_SET 0x10F0222                     //	function DO(program paused) set	功能DO（作业程序暂停）置位
#define INFO_FDO_PAUSE_RESET 0x10F0223                   //	function DO(program paused) reset	功能DO（作业程序暂停）复位
#define INFO_FDO_RUNNING_SET 0x10F0224                   //	function DO(program running) set	功能DO（作业程序运行中）置位
#define INFO_FDO_RUNNING_RESET 0x10F0225                 //	function DO(program running) reset	功能DO（作业程序运行中）复位
#define INFO_FDO_FAULT_SET 0x10F0226                     //	function DO(motion fault) set	功能DO（控制系统故障）置位
#define INFO_FDO_FAULT_RESET 0x10F0227                   //	function DO(motion fault) reset	功能DO（控制系统故障）复位
#define INFO_FDO_POWERON_SET 0x10F0228                   //	function DO(powered on) set	功能DO（机器人电源已打开）置位
#define INFO_FDO_POWERON_RESET 0x10F0229                 //	function DO(powered on) reset	功能DO（机器人电源已打开）复位
#define INFO_FDO_ENABLED_SET 0x10F022a                   //	function DO(servo enabled) set	功能DO（伺服使能已打开）置位
#define INFO_FDO_ENABLED_RESET 0x10F022b                 //	function DO(servo enabled) reset	功能DO（伺服使能已打开）复位
#define INFO_FDO_MOTION_SET 0x10F022c                    //	function DO(robot moving) set	功能DO（机器人运动中）置位
#define INFO_FDO_MOTION_RESET 0x10F022d                  //	function DO(robot moving) reset	功能DO（机器人运动中）复位
#define INFO_FDO_STATIC_SET 0x10F022e                    //	function DO(robot in position) set	功能DO（机器人静止）置位
#define INFO_FDO_STATIC_RESET 0x10F022f                  //	function DO(robot in position) reset	功能DO（机器人静止）复位
#define INFO_FDO_BOOT_SET 0x10F0230                      //	function DO(robot system on) set	功能DO（控制系统已就绪）置位
#define INFO_FDO_BOOT_RESET 0x10F0231                    //	function DO(robot system on) reset	功能DO（控制系统已就绪）复位
#define INFO_FDO_ESTOP_SET 0x10F0232                     //	function DO(robot estop) set	功能DO（机器人急停）置位
#define INFO_FDO_ESTOP_RESET 0x10F0233                   //	function DO(robot estop) reset	功能DO（机器人急停）复位
#define INFO_FDO_PERCENTAGE_MODE_LEVEL2_SET 0x10F0234    //	function DO(percentage mode level 2) set	功能DO（机器人处于二级倍率模式）置位
#define INFO_FDO_PERCENTAGE_MODE_LEVEL2_RESET 0x10F0235  //	function DO(percentage mode level 2) reset	功能DO（机器人处于二级倍率模式）复位
#define INFO_FDO_PROTECTIVE_STOP_SET 0x10F0236           //	function DO(protective stop) set	功能DO（机器人处于保护性停止）置位
#define INFO_FDO_PROTECTIVE_STOP_RESET 0x10F0237         //	function DO(protective stop) reset	功能DO（机器人处于保护性停止）复位
#define INFO_FDO_AT_INITPOSE_SET 0x10F0238               //	function DO(at initial position) set	功能DO（机器人处于初始位）置位
#define INFO_FDO_AT_INITPOSE_RESET 0x10F0239             //	function DO(at initial position) reset	功能DO（机器人处于初始位）复位
#define INFO_FDO_PERCENTAGE_MODE_LEVEL1_SET 0x10F0240    //	function DO(percentage mode level 1) set	功能DO（机器人处于一级倍率模式）置位
#define INFO_FDO_PERCENTAGE_MODE_LEVEL1_RESET 0x10F0241  //	function DO(percentage mode level 1) reset	功能DO（机器人处于一级倍率模式）复位

#define INFO_SFDI_EX_ESTOP_TRIGED 0x10F0250            //	safety function DI(additial estop) triggered	安全功能DI（附加急停）已触发
#define INFO_SFDI_EX_PROTECTIVE_STOP_TRIGED 0x10F0251  //	safety function DI(additial protective stop) triggered	安全功能DI（附加保护性停止）已触发
#define INFO_SFDI_PROTECTIVE_STOP_RESET_TRIGED 0x10F0252  //	safety function DI(reset protective stop) triggered	安全功能DI（保护性停止复位）已触发
#define INFO_SFDI_REDUCED_MODE_TRIGED 0x10F0253           //	safety function DI(reduce mode) triggered	安全功能DI（缩减模式）已触发
#define INFO_SFDI_THREE_POSITION_ENABLING 0x10F0254  //safety function DI(three position enabling) triggered  安全功能DI三位置使能（JOG、拖拽、调试限制）已触发
#define INFO_SFDI_SET_CLSN_LEVEL0 0x10F0255  //safety function DI(SET collision sensitivity level0) triggered  安全功能DI设置碰撞灵敏度（level0）已触发
#define INFO_SFDI_SET_CLSN_LEVEL1 0x10F0256  //safety function DI(SET collision sensitivity level1) triggered  安全功能DI设置碰撞灵敏度（level1）已触发
#define INFO_SFDI_SET_CLSN_LEVEL2 0x10F0257  //safety function DI(SET collision sensitivity level2) triggered  安全功能DI设置碰撞灵敏度（level2）已触发
#define INFO_SFDI_SET_CLSN_LEVEL3 0x10F0258  //safety function DI(SET collision sensitivity level3) triggered  安全功能DI设置碰撞灵敏度（level3）已触发
#define INFO_SFDI_SET_CLSN_LEVEL4 0x10F0259  //safety function DI(SET collision sensitivity level4) triggered  安全功能DI设置碰撞灵敏度（level4）已触发
#define INFO_SFDI_SET_CLSN_LEVEL5 0x10F025A  //safety function DI(SET collision sensitivity level5) triggered  安全功能DI设置碰撞灵敏度（level5）已触发
#define INFO_SFDI_SET_CLSN_LEVEL7 0x10F025B  //safety function DI(SET collision sensitivity level7) triggered  安全功能DI设置碰撞灵敏度（level7）已触发

#define INFO_SFDO_BTNESTOP_SET 0x10F0260           //	safety function DO(button estop) set	安全功能DO（按钮急停触发）置位
#define INFO_SFDO_BTNESTOP_RESET 0x10F0261         //	safety function DO(button estop) reset	安全功能DO（按钮急停触发）复位
#define INFO_SFDO_SYSESTOP_SET 0x10F0262           //	safety function DO(system estop) set	安全功能DO（系统急停触发）置位
#define INFO_SFDO_SYSESTOP_RESET 0x10F0263         //	safety function DO(system estop) reset	安全功能DO（系统急停触发）复位
#define INFO_SFDO_PROTECTIVE_STOP_SET 0x10F0264    //	safety function DO(protective stop) set	安全功能DO（保护性停止）置位
#define INFO_SFDO_PROTECTIVE_STOP_RESET 0x10F0265  //	safety function DO(protective stop) reset	安全功能DO（保护性停止）复位
#define INFO_SFDO_MOVING_SET 0x10F0266             //	safety function DO(robot moving) set	安全功能DO（机器人运动中）置位
#define INFO_SFDO_MOVING_RESET 0x10F0267           //	safety function DO(robot moving) reset	安全功能DO（机器人运动中）置位
#define INFO_SFDO_REDUCED_MODE_SET 0x10F0268       //	safety function DO(reduced mode) set	安全功能DO（缩减模式）置位
#define INFO_SFDO_REDUCED_MODE_RESET 0x10F0269     //	safety function DO(reduced mode) reset	安全功能DO（缩减模式）复位

#define WARNING_DOUT_PORT_UNAVAILABLE 0x10F026A  // Digital output port unavailable ( do 被配置为功能DO 或 安全DO ，不允许通过脚本指令设置Dout)

#define INFO_DYNAMIC_IDNEITFY_COMPLETE 0x10F0280   // dynamics identify complete. 动力学参数辨识完成
#define INFO_FRICTION_IDNEITFY_COMPLETE 0x10F0281  // friction identify complete. 摩擦力参数辨识完成
#define INFO_WRITE_DYNAMICS_COMPLETE 0x10F0282     // dynamics writing complete. 写动力学参数完成, 重起机器人生效

#define INFO_COLLISION_REBOUND_ABORT 0x10F0283       // 碰撞位置离运动起点过近，碰撞反弹将终止以保证安全.
#define INFO_COLLISION_REBOUND_ABORT_STOP 0x10F0284  // 碰撞位置离运动终点过近，碰撞反弹将终止以保证安全.

/*********************************infos related to program (start)****************************************/
#define INTERP_EXECUTION_COMPLITED 0x10F2000  /*Program execution completed.*/
#define INTERP_EXECUTION_TERMINATED 0x10F2001 /*Terminate program execution.*/

/*********************************infos related to program (end)****************************************/

/******************************information code definition(end)******************************/

enum class ErrTag
{
    RESERVE0 = 0,
    BP = 1,
    SCB = 2,
    AXIS = 3,
    TIO = 4,
    ROB = 5,
    TASK = 6,
    IO = 7,
    SF = 8,
    RESERVE1 = 9,
    RESERVE2 = 10,
    RESERVE3 = 11,
    RESERVE4 = 12,
    RESERVE5 = 13,
    RESERVE6 = 14,
    RESERVE7 = 15,
};
enum class AxisEvCode
{
    STA_ERR_OFFLINE = 0x1,           //通讯中断
    STA_INFO_SHUTDOWN = 0x3,         //电源断开
    CMD_ERR_ENABLE_TIMEOUT = 0x100,  //使能指令超时

    //伺服上报的错误码
    STA_ERR_DRV_POS_DEVIATION = 0x8000,   //伺服检测到位置偏差过大报错
    STA_WARN_DRV_POS_DEVIATION = 0x8001,  //伺服检测到位置偏差过大预警

    UNKONWN = 0xffff,
};
enum class RobEvCode
{
    OFFLINE = 0x1,
    JOINT_ERR = 0x2,
    BOOT_NO_FOUND_JOINT = 0x3,     //上电超时，未找到全部关节
    BOOT_SYNC_DATA_TIMEOUT = 0x4,  //上电同步初始化超时
    ENABLING_OVER_PAYLOAD = 0x5,   //使能过程中检测到超载
    ENABLING_TIMEOUT = 0x6,        //使能超时
    JOINT_DISABLE = 0x07,          //关节处于使能断开状态
    ENABLE_TOO_FREQUENTLY = 0x08,  //使能操作过于频繁

    CMD_CANNOT_ENABLE_WHEN_BOOTING = 0x2005,  //上电初始化过程中，不能执行伺服使能操作
    UNKONWN = 0xffff,
};
enum class ScbEvCode
{
    OFFLINE = 0x1,
    UNKONWN = 0xffff,
};
enum class TioEvCode
{
    OFFLINE = 0x1,
    UNKONWN = 0xffff,
};
enum class BpEvCode
{
    OFFLINE = 0x1,
    UNKONWN = 0xffff,
};
enum class TaskEvCode
{
    UNKONWN = 0xffff,
};
enum class IOEvCode
{
    UNKONWN = 0xffff,
};
enum class SafeEvCode
{
    UNKONWN = 0xffff,
};

//事件码格式：0xMMIIEEEE，其中MM表示模块号，II表示索引号，EEEE表示错误号
constexpr uint32_t SAFE_EV(IOEvCode code) { return ((uint8_t)ErrTag::SF << 24) + (uint16_t)code; }
constexpr uint32_t IO_EV(IOEvCode code) { return ((uint8_t)ErrTag::IO << 24) + (uint16_t)code; }
constexpr uint32_t TASK_EV(TaskEvCode code) { return ((uint8_t)ErrTag::TASK << 24) + (uint16_t)code; }
constexpr uint32_t BP_EV(BpEvCode code) { return ((uint8_t)ErrTag::BP << 24) + (uint16_t)code; }
constexpr uint32_t SCB_EV(ScbEvCode code, uint8_t index = 0) { return ((uint8_t)ErrTag::SCB << 24) + (index + 1 << 16) + (uint16_t)code; }
constexpr uint32_t ROB_EV(RobEvCode code, uint8_t index = 0) { return ((uint8_t)ErrTag::ROB << 24) + (index + 1 << 16) + (uint16_t)code; }
constexpr uint32_t TIO_EV(TioEvCode code, uint8_t index = 0) { return ((uint8_t)ErrTag::TIO << 24) + (index + 1 << 16) + (uint16_t)code; }
constexpr uint32_t AXIS_EV(AxisEvCode code, uint8_t index) { return ((uint8_t)ErrTag::AXIS << 24) + (index + 1 << 16) + (uint16_t)code; }